openclaw - ✅(Solved) Fix [Feature]: Real-time agent activity dashboard — execution tree, timeline, and live metrics [1 pull requests, 2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#60810Fetched 2026-04-08 02:46:56
View on GitHub
Comments
2
Participants
2
Timeline
5
Reactions
1
Author
Participants
Timeline (top)
commented ×2referenced ×2cross-referenced ×1

Real-time agent activity dashboard showing what the agent is doing behind the scenes — execution tree, tool calls, thinking steps, and timeline — replacing the current black-box experience.

Error Message

Each node shows: agent ID, action type (thinking/tool/delegation/output), status (pending/running/done/error), duration, and token cost.

  • agent.error with recovery status
  • Error count and rate | 'tool.call' | 'tool.result' | 'agent.error' | 'agent.delegation';
  • EventBus (src/lib/agent-core/events/EventBus.ts): Typed pub/sub with correlation IDs, wildcard subscriptions, and async handlers — emits agent.start, agent.end, agent.thinking, tool.call, tool.result, agent.error events

Root Cause

Real-time agent activity dashboard showing what the agent is doing behind the scenes — execution tree, tool calls, thinking steps, and timeline — replacing the current black-box experience.

Fix Action

Fix / Workaround

Gateway side:

  • Instrument the Pi agent loop to emit AgentActivityEvent at each phase (thinking start/end, tool dispatch/return, delegation, completion)
  • Events flow through the existing WS broadcast mechanism (same path as chat SSE)
  • Events are ephemeral by default (not persisted), with an opt-in flag to write to session history for post-hoc inspection

PR fix notes

PR #60814: feat: real-time agent activity dashboard

Description (problem / solution / changelog)

Summary

  • Adds a real-time agent activity panel to the Control UI
  • Execution tree, timeline, and live metrics for full visibility into what the agent is doing
  • Eliminates the black-box experience during multi-step agent tasks

Closes #60810

Approach

Gateway side: Instrument the Pi agent loop to emit typed AgentActivityEvent messages over the existing WS protocol at each phase (thinking, tool dispatch/return, delegation, completion).

Control UI side: New AgentActivity panel subscribing to the activity event stream with:

  • ExecutionTree — live-updating tree with expand/collapse
  • Timeline — virtual-scrolled event stream with filters
  • MetricsSidebar — live token/cost/error counters

Prior art

Adapted from a system I've created agent observability stack:

  • EventBus (typed pub/sub with correlation IDs)
  • ExecutionTree (delegation chains with cycle detection and cost rollups)
  • ExecutionVisualizer (timeline + graph layout)
  • Metrics (counter/gauge/histogram collectors)

Test plan

  • Gateway emits AgentActivityEvent for thinking, tool calls, delegations
  • Control UI renders execution tree in real time
  • Timeline filters by event type, agent, and session
  • Metrics sidebar shows live token/cost counters
  • No regression on existing WS protocol clients
  • Events are ephemeral by default (no storage overhead)

Changed files

  • src/agents/agent-command.ts (modified, +24/-0)
  • src/agents/pi-embedded-subscribe.handlers.lifecycle.ts (modified, +27/-0)
  • src/agents/pi-embedded-subscribe.handlers.messages.ts (modified, +13/-0)
  • src/agents/pi-embedded-subscribe.handlers.tools.ts (modified, +28/-0)
  • src/agents/subagent-registry-completion.ts (modified, +24/-0)
  • src/agents/subagent-spawn.ts (modified, +27/-0)
  • src/infra/activity-events.test.ts (added, +90/-0)
  • src/infra/activity-events.ts (added, +59/-0)
  • ui/src/i18n/locales/de.ts (modified, +2/-0)
  • ui/src/i18n/locales/en.ts (modified, +2/-0)
  • ui/src/i18n/locales/es.ts (modified, +2/-0)
  • ui/src/i18n/locales/pt-BR.ts (modified, +2/-0)
  • ui/src/i18n/locales/zh-CN.ts (modified, +2/-0)
  • ui/src/i18n/locales/zh-TW.ts (modified, +2/-0)
  • ui/src/styles.css (modified, +1/-0)
  • ui/src/styles/activity.css (added, +489/-0)
  • ui/src/ui/activity/activity-controller.ts (added, +288/-0)
  • ui/src/ui/activity/activity-metrics-history.ts (added, +30/-0)
  • ui/src/ui/activity/activity-tree.test.ts (added, +330/-0)
  • ui/src/ui/activity/activity-tree.ts (added, +443/-0)
  • ui/src/ui/activity/activity-types.ts (added, +36/-0)
  • ui/src/ui/app-gateway.ts (modified, +7/-4)
  • ui/src/ui/app-render.ts (modified, +7/-0)
  • ui/src/ui/app-tool-stream.ts (modified, +5/-0)
  • ui/src/ui/app-view-state.ts (modified, +1/-0)
  • ui/src/ui/app.ts (modified, +3/-0)
  • ui/src/ui/icons.ts (modified, +5/-0)
  • ui/src/ui/navigation.ts (modified, +5/-1)
  • ui/src/ui/views/activity-detail.ts (added, +206/-0)
  • ui/src/ui/views/activity-filters.ts (added, +83/-0)
  • ui/src/ui/views/activity-metrics.ts (added, +83/-0)
  • ui/src/ui/views/activity-timeline.ts (added, +81/-0)
  • ui/src/ui/views/activity-tree-node.ts (added, +89/-0)
  • ui/src/ui/views/activity.ts (added, +99/-0)

Code Example

[agent:main] Processing user request
  ├─ [thinking] Analyzing code structure...
  ├─ [tool:file_read] src/gateway/config.ts  (120ms)
  ├─ [tool:web_search] "openclaw gateway auth"  (850ms)
  ├─ [thinking] Comparing approaches...
  └─ [tool:file_write] src/gateway/auth.ts  (in progress)

---

// New event types on the gateway WS protocol
interface AgentActivityEvent {
  type: 'agent.start' | 'agent.end' | 'agent.thinking' | 'agent.iteration'
      | 'tool.call' | 'tool.result' | 'agent.error' | 'agent.delegation';
  metadata: {
    eventId: string;
    timestamp: Date;
    correlationId: string;   // ties events to a single request
    sessionKey: string;
    agentId: string;
    traceId?: string;        // for distributed tracing
  };
  payload: Record<string, unknown>;  // type-specific data
}
RAW_BUFFERClick to expand / collapse

Summary

Real-time agent activity dashboard showing what the agent is doing behind the scenes — execution tree, tool calls, thinking steps, and timeline — replacing the current black-box experience.

Problem to solve

The current Control UI provides post-hoc views (logs, sessions, usage) but no live visibility into what the agent is doing right now. When an agent is processing a request — reasoning, calling tools, delegating to sub-agents, waiting on external APIs — the user sees nothing until the final response arrives. This creates a black-box experience that makes it hard to:

  • Debug: understand why a response is slow, stuck, or wrong
  • Trust: know the agent is working and not looping or erroring silently
  • Learn: see how the agent breaks down problems and uses tools
  • Intervene: cancel or redirect a runaway execution before it burns tokens

This is especially painful for multi-step tasks, cron jobs running in the background, and multi-agent routing scenarios where execution spans multiple agents and tool chains.

Proposed solution

A new Agent Activity panel in the Control UI (new sidebar tab or overlay accessible from Overview) with three layers:

1. Execution Tree (live)

A real-time tree/graph view of the current execution:

[agent:main] Processing user request
  ├─ [thinking] Analyzing code structure...
  ├─ [tool:file_read] src/gateway/config.ts ✓ (120ms)
  ├─ [tool:web_search] "openclaw gateway auth" ✓ (850ms)
  ├─ [thinking] Comparing approaches...
  └─ [tool:file_write] src/gateway/auth.ts ⏳ (in progress)

Each node shows: agent ID, action type (thinking/tool/delegation/output), status (pending/running/done/error), duration, and token cost.

2. Timeline (chronological)

A time-ordered event stream with filtering by event type, agent, and session:

  • agent.start / agent.end with duration and iteration count
  • agent.thinking with content preview (collapsible)
  • tool.call / tool.result with input/output summaries
  • agent.error with recovery status
  • agent.delegation for multi-agent handoffs

3. Metrics sidebar

Live counters during execution:

  • Tokens consumed (input/output/cache)
  • Tool calls count and latency histogram
  • Active agents and delegation depth
  • Error count and rate

Architecture approach

OpenClaw's gateway already emits structured events over WebSocket. The proposal extends this with a typed event envelope that the Control UI can subscribe to:

// New event types on the gateway WS protocol
interface AgentActivityEvent {
  type: 'agent.start' | 'agent.end' | 'agent.thinking' | 'agent.iteration'
      | 'tool.call' | 'tool.result' | 'agent.error' | 'agent.delegation';
  metadata: {
    eventId: string;
    timestamp: Date;
    correlationId: string;   // ties events to a single request
    sessionKey: string;
    agentId: string;
    traceId?: string;        // for distributed tracing
  };
  payload: Record<string, unknown>;  // type-specific data
}

Gateway side:

  • Instrument the Pi agent loop to emit AgentActivityEvent at each phase (thinking start/end, tool dispatch/return, delegation, completion)
  • Events flow through the existing WS broadcast mechanism (same path as chat SSE)
  • Events are ephemeral by default (not persisted), with an opt-in flag to write to session history for post-hoc inspection

Control UI side:

  • New AgentActivity panel component (Svelte/Lit) subscribing to the activity event stream
  • ExecutionTree component rendering a live-updating tree with expand/collapse
  • Timeline component with virtual scrolling and event-type filters
  • MetricsSidebar with live counters derived from the event stream
  • All rendering is client-side from the WS stream — no new API endpoints needed

Prior art / reference implementation

I've built a similar system, a multi-tenant AI agent orchestration platform, which has:

  • EventBus (src/lib/agent-core/events/EventBus.ts): Typed pub/sub with correlation IDs, wildcard subscriptions, and async handlers — emits agent.start, agent.end, agent.thinking, tool.call, tool.result, agent.error events
  • ExecutionTree (src/lib/agent-core/execution/ExecutionTree.ts): Tree structure tracking agent delegation chains with depth limits, cycle detection, and per-node cost rollups
  • ExecutionVisualizer (src/lib/agent-core/visualization/ExecutionVisualizer.ts): Converts execution state into timeline events and graph layouts for the UI
  • Metrics (src/lib/agent-core/observability/Metrics.ts): Counter/Gauge/Histogram collectors with label support and exporters

The key architectural difference is that system is a monolithic SvelteKit app where events flow in-process, while OpenClaw's gateway architecture means events need to flow over the existing WebSocket protocol. But the event taxonomy and UI patterns map directly.

I'd be happy to contribute a proof-of-concept implementation adapting these patterns to OpenClaw's gateway protocol and Control UI.

Alternatives considered

  • Expanding the existing Logs tab: The logs tab shows raw gateway log lines, which are too noisy and unstructured for understanding agent behavior. A structured activity view is fundamentally different from log tailing.
  • Adding more detail to the Chat view: The chat already shows tool calls when toggled, but it's interleaved with conversation flow and doesn't show thinking, delegation, or timing. A dedicated panel keeps concerns separated.
  • External observability (Grafana/OTEL): OpenClaw already has some OTEL instrumentation, but this requires a separate stack and doesn't integrate into the Control UI for real-time visibility. The proposal is complementary — OTEL for ops teams, Activity panel for end users.

Impact

  • Affected: All gateway users, especially those running multi-agent workspaces, cron jobs, or complex tool-heavy workflows
  • Severity: High — the black-box problem is the single biggest UX gap when operating an agent gateway
  • Frequency: Every interaction where the agent takes more than a few seconds
  • Consequence: Users can't tell if the agent is working, stuck, or erroring; they end up resubmitting messages, checking logs manually, or waiting blindly. Power users who run background cron agents have zero visibility without SSH-ing into logs.

Evidence/examples

  • What i did implements this pattern successfully with its EventBus + ExecutionTree + ExecutionVisualizer stack
  • Claude Code's own terminal UI shows thinking/tool-call progress in real time — the same experience should be available in OpenClaw's web dashboard
  • Cursor and Windsurf IDEs both show live agent activity panels, validating the UX pattern

Additional information

  • The existing Event Log section on the Overview page (visible in the current UI) already shows tick/health events — this proposal extends that pattern to agent-level granularity
  • The gateway WS protocol (src/gateway/protocol/) supports additive evolution per the repo's boundary guidelines, so new event types can be added without breaking existing clients
  • Happy to start with a scoped PR covering just the event emission from the agent loop + a minimal tree view component, then iterate

extent analysis

TL;DR

Implement a new Agent Activity panel in the Control UI to provide live visibility into agent execution, including an execution tree, timeline, and metrics sidebar.

Guidance

  1. Extend the gateway's WebSocket protocol to include new event types for agent activity, such as agent.start, agent.end, agent.thinking, and tool.call.
  2. Instrument the Pi agent loop to emit these new events at each phase of execution, allowing the Control UI to subscribe to the event stream.
  3. Create a new AgentActivity panel component in the Control UI to render the live execution tree, timeline, and metrics sidebar, using the event stream from the gateway.
  4. Implement filtering and virtual scrolling in the timeline component to improve performance and usability.
  5. Test and iterate on the implementation, starting with a minimal proof-of-concept and expanding to cover all required features.

Example

// Example event emission from the Pi agent loop
const emitEvent = (type: string, metadata: any, payload: any) => {
  // Emit event over WebSocket protocol
};

// Emit events at each phase of execution
emitEvent('agent.start', { agentId: 'main' }, { });
emitEvent('agent.thinking', { agentId: 'main' }, { content: 'Analyzing code structure...' });
emitEvent('tool.call', { agentId: 'main', toolId: 'file_read' }, { input: 'src/gateway/config.ts' });

Notes

  • The implementation should follow the existing boundary guidelines for the gateway WS protocol to ensure additive evolution without breaking existing clients.
  • The new event types and payload structures should be designed to be extensible and flexible for future additions.
  • The Control UI component should be designed to handle errors and disconnections from the event stream gracefully.

Recommendation

Apply the proposed workaround by implementing the new Agent Activity panel and extending the gateway's WebSocket protocol to provide live visibility into agent execution. This will address the current black-box experience and provide a better user experience for debugging, trusting, learning, and intervening in agent execution.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING