930aaeb
CopilotKitDocs
  • Docs
  • Integrations
  • Reference
Get Started
QuickstartCoding Agents
Concepts
ArchitectureGenerative UI OverviewOSS vs Enterprise
Agentic Protocols
OverviewAG-UIAG-UI MiddlewareMCPA2A
Build Chat UIs
Prebuilt Components
CopilotChatCopilotSidebarCopilotPopup
Custom Look and Feel
CSS CustomizationSlots (Subcomponents)Fully Headless UIReasoning Messages
Multimodal AttachmentsVoice
Build Generative UI
Controlled
Tool-based Generative UITool RenderingState RenderingReasoning
Your Components
Display ComponentsInteractive Components
Declarative
A2UIDynamic Schema A2UIFixed Schema A2UI
Open-Ended
MCP Apps
Adding Agent Powers
Frontend ToolsShared State
Human-in-the-Loop
HITL OverviewPausing the Agent for InputHeadless Interrupts
Sub-AgentsAgent ConfigProgrammatic Control
Agents & Backends
Built-in Agent
Backend
Copilot RuntimeFactory ModeAG-UI
Runtime Server AdapterAuthentication
AG2
Shared state
Reading agent stateWriting agent state
Readables
Observe & Operate
InspectorVS Code Extension
Troubleshooting
Common Copilot IssuesError Debugging & ObservabilityDebug ModeAG-UI Event InspectorHook ExplorerError Observability Connectors
Enterprise
CopilotKit PremiumHow the Enterprise Intelligence Platform WorksHow Threads & Persistence WorkObservabilitySelf-Hosting IntelligenceThreads
Deploy
AWS AgentCore
What's New
Full MCP Apps SupportLangGraph Deep Agents in CopilotKitA2UI Launches with full AG-UI SupportCopilotKit v1.50Generative UI Spec SupportA2A and MCP Handshake
Migrate
Migrate to V2Migrate to 1.8.2
Other
Contributing
Code ContributionsDocumentation Contributions
Anonymous Telemetry
AG2TroubleshootingAG-UI Event Inspector

AG-UI Event Inspector

Inspect AG-UI events in real time with the VSCode extension

The AG-UI Event Inspector gives you a live view of every event flowing between your CopilotKit runtime and client. Instead of sprinkling console.log statements through your agent code, you can watch the full AG-UI event stream in a filterable, color-coded panel inside VS Code.

Use it when:

  • An agent interaction isn't behaving as expected and you need to see which events the runtime is actually emitting
  • You want to understand the AG-UI event lifecycle (e.g., how RUN_STARTED flows through TEXT_MESSAGE_CONTENT chunks to RUN_FINISHED)
  • You need to inspect tool call arguments or state deltas for a specific interaction
The threads tab needs Intelligence
When you open the Inspector, threads is the default tab. Sign up for the free Developer tier to see your conversation history.
Get Intelligence free

Prerequisites#

  • A CopilotKit runtime running locally in development mode (NODE_ENV is not production)
  • The CopilotKit VS Code extension installed
Warning

The /cpk-debug-events endpoint is disabled when NODE_ENV=production. This is intentional — it streams internal event data that should not be exposed in production environments.

Connect and inspect#

Ensure your runtime is running in development mode#

The debug event endpoint is available at GET /cpk-debug-events on your CopilotKit runtime. It activates automatically when NODE_ENV !== 'production' — no extra configuration needed. If you're using the default dev setup, you're already good to go.

Open the AG-UI Inspector#

Open the VS Code command palette (Ctrl+Shift+P / Cmd+Shift+P) and run:

CopilotKit: Open AG-UI Inspector

This opens a dedicated webview panel.

Enter your runtime URL and connect#

Type your runtime URL in the input field at the top of the panel (default: http://localhost:4000) and click Connect. The panel status indicator turns green when the SSE connection is established.

Trigger an agent interaction#

Go to your app and perform an action that triggers an agent run — send a chat message, invoke a tool, or interact with any CopilotKit-powered component. Events start streaming into the inspector immediately.

Read the event stream#

Each event row shows:

  • Timestamp — relative time since the first event (e.g., +0.142s)
  • Event type badge — color-coded by category (see table below)
  • Summary — key fields like message ID, tool name, or a text preview

Filter events#

Use the category filter buttons at the top of the panel to show or hide event categories. You can also search event payloads with the search field to find specific tool names, message IDs, or content.

Inspect event details#

Click any event row to expand the full JSON payload in the detail panel. This shows every field the runtime emitted for that event, including agentId, threadId, runId, and the complete event data.

Event type reference#

CategoryColorEvent TypesDescription
LifecyclePurpleRUN_STARTED, RUN_FINISHEDMarks the start and end of an agent run
ErrorsRedRUN_ERRORAn error occurred during the agent run
Text MessagesBlueTEXT_MESSAGE_START, TEXT_MESSAGE_CONTENT, TEXT_MESSAGE_END, TEXT_MESSAGE_CHUNKText streamed from the agent to the client
Tool CallsOrangeTOOL_CALL_START, TOOL_CALL_ARGS, TOOL_CALL_END, TOOL_CALL_CHUNK, TOOL_CALL_RESULTTool invocation lifecycle — name, arguments, and result
ReasoningGreenREASONING_START, REASONING_MESSAGE_START, REASONING_MESSAGE_CONTENT, REASONING_MESSAGE_END, REASONING_ENDModel reasoning/chain-of-thought events
StateTealSTATE_SNAPSHOT, STATE_DELTAAgent state snapshots and incremental updates
Activity/UIYellowACTIVITY_SNAPSHOT, ACTIVITY_DELTAUI activity indicators and progress updates
Info

For console-level debug logging and programmatic error handling in your app, see Error Debugging. If you're debugging a render prop rather than a runtime event stream, the Hook Explorer is the offline, render-first complement to this tool.

On this page
PrerequisitesConnect and inspectEnsure your runtime is running in development modeOpen the AG-UI InspectorEnter your runtime URL and connectTrigger an agent interactionRead the event streamFilter eventsInspect event detailsEvent type reference