ChatDebugComponent
ChatDebugComponent is a full debug cockpit that combines a chat interface with a side panel for inspecting LangGraph execution state. It renders the same chat UI as ChatComponent alongside a debug panel with a timeline, state inspector, diff viewer, and navigation controls.
Selector: chat-debug
Import:
When to Use It
Use ChatDebugComponent during development to understand what your LangGraph agent is doing at each step. The debug panel shows:
- A timeline of execution checkpoints
- State values at each checkpoint
- A diff between consecutive checkpoints
- Navigation controls to step through the execution history
Basic Usage
API
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
agent | AgentWithHistory | Required | The agent providing streaming state and execution history |
Layout
The component renders a two-column layout:
- Left: The chat area (messages, typing indicator, error display, input)
- Right: The collapsible debug panel (320px wide)
The debug panel can be toggled open/closed with a button on the divider.
Debug Panel Sections
Summary
At the top, DebugSummaryComponent displays the total number of checkpoints and cumulative execution duration.
Controls
DebugControlsComponent provides VCR-style navigation buttons:
| Button | Action | Disabled When |
|---|---|---|
|< | Jump to start | Already at first checkpoint |
< | Step back | Already at first checkpoint |
> | Step forward | Already at last checkpoint |
>| | Jump to end | Already at last checkpoint |
Timeline
DebugTimelineComponent renders a vertical timeline rail with one DebugCheckpointCardComponent per checkpoint. Each card shows:
- The node name (from
state.next[0]or"Step N") - Optional duration badge (milliseconds)
- Optional token count badge
- Visual selection state (highlighted dot and border)
Click a checkpoint to select it and view its details below.
Detail
When a checkpoint is selected, DebugDetailComponent renders two sections:
-
State Diff (
DebugStateDiffComponent): Shows what changed between the previous and current checkpoint as color-coded entries:- Green (
+): Added keys - Red (
-): Removed keys - Yellow (
~): Changed values (shows before and after)
- Green (
-
Current State (
DebugStateInspectorComponent): Displays the full state values as formatted JSON.
Debug Sub-Components
Each debug sub-component is exported individually for custom debug UIs:
| Component | Selector | Purpose |
|---|---|---|
DebugTimelineComponent | chat-debug-timeline | Vertical timeline of checkpoints |
DebugCheckpointCardComponent | chat-debug-checkpoint-card | Single checkpoint card in the timeline |
DebugControlsComponent | chat-debug-controls | VCR-style step navigation |
DebugSummaryComponent | chat-debug-summary | Step count and total duration |
DebugDetailComponent | chat-debug-detail | State diff + state inspector |
DebugStateDiffComponent | chat-debug-state-diff | Color-coded state diff |
DebugStateInspectorComponent | chat-debug-state-inspector | JSON state viewer |
Debug Utilities
toDebugCheckpoint()
Converts a ThreadState entry to a DebugCheckpoint:
extractStateValues()
Extracts the state values from a ThreadState, returning {} if unavailable:
computeStateDiff()
Computes a recursive diff between two state objects:
DebugCheckpoint Type
DiffEntry Type
Building a Custom Debug Panel
You can use the sub-components individually to build a custom debug layout: