Skip to content

Bound dashboard runtime events before RPC serialization #448

Closed

Description

@aebrer

Original Request

When AgentWorld is working (but not Qwen 3.6) I get a ton of intermittent issues on the dashboard, including at one point this one:

{"error":"Client is not a known Tailscale peer","needsPairing":false}

Basically it just gets buggy and has trouble loading the live state. Again, does not happen with the 3.6 model (which is good).

We also already fixed the first of those two related dreb issues already

Good research thanks! Let's load mach6 issue and post all three.

Summary

The dashboard now bounds browser-facing SSE frames, but high-rate model events still carry cumulative assistant state across the internal dreb-child RPC JSONL pipe before that projection occurs. Long AgentWorld responses therefore create quadratic internal serialization, unbounded stdout queuing, and large end-of-response event bursts that make live state appear frozen or delayed.

Current Behavior

A dashboard runtime launches dreb in RPC mode with --ui dashboard. Every message_update is emitted unchanged by runRpcMode(), including both cumulative representations:

  • top-level message
  • nested assistantMessageEvent.partial

writeRawStdout() ignores the boolean backpressure result from the underlying stream. The dashboard removes cumulative fields only after RpcClient has read and parsed each JSONL record.

In the observed post-fix workload:

  • llama.cpp generated 6,673 tokens at roughly 82 tokens per second.
  • Browser-facing SSE frames remained bounded at roughly 163–170 bytes.
  • The dashboard nevertheless published 6,401 events in a three-second completion burst: 2,718, 2,942, then 741 events per second.
  • The stream showed long pauses followed by catch-up bursts rather than steady live delivery.

Proposed Behavior

Project dashboard-specific streaming events before internal RPC JSONL serialization and keep the child stdout queue bounded. Preserve generic RPC compatibility unless a deliberate, documented protocol change is selected during planning.

Acceptance Criteria

  • Dashboard-mode message_update events remove cumulative top-level message and nested assistantMessageEvent.partial before JSONL serialization, including nested background-agent events.
  • Deltas, finalized content/tool calls, transcript behavior, and authoritative recovery remain correct.
  • A long high-rate regression proves bounded individual records, near-linear aggregate internal-RPC bytes, and bounded stdout queuing rather than end-of-response catch-up bursts.
  • Non-dashboard RPC consumers retain their existing protocol behavior unless a separately documented wire change is deliberately chosen.

Context

The browser-facing projection fix is already merged:

That fix is functioning at the EventHub boundary: the new incident did not show cumulative SSE frame growth, replay-budget failure, or server-side SSE backpressure. This follow-up covers the earlier child-process transport boundary that the EventHub cannot protect.

Technical Notes

Relevant areas:

  • packages/coding-agent/src/modes/rpc/rpc-mode.ts
  • packages/coding-agent/src/core/output-guard.ts
  • packages/coding-agent/src/modes/rpc/rpc-client.ts
  • packages/dashboard/src/server/runtime-pool.ts
  • packages/dashboard/src/server/event-hub.ts
  • RPC, runtime-pool, and EventHub streaming tests

The dashboard already passes --ui dashboard, which may provide a narrow compatibility boundary for dashboard-only projection. Planning should also account for nested background_agent_event payloads and explicit stream backpressure behavior rather than relying only on smaller records.

Activity

  1. added
    bug
    dashboard
    on Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugdashboard

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions