Skip to content

feat: dashboard SSE streaming progress (#1007)#1032

Open
theonlychant wants to merge 2 commits intoamd:mainfrom
theonlychant:feat/sse-dashboard-progress
Open

feat: dashboard SSE streaming progress (#1007)#1032
theonlychant wants to merge 2 commits intoamd:mainfrom
theonlychant:feat/sse-dashboard-progress

Conversation

@theonlychant
Copy link
Copy Markdown
Contributor

@theonlychant theonlychant commented May 11, 2026

Summary

Surfaces the existing SSE event stream on the Triage Dashboard during long-running inbox scans, giving users real-time step-by-step feedback instead of an indeterminate spinner.

Why

Refresh and pre-scan runs against a busy inbox can take tens of seconds. With no per-step feedback the UI reads as broken. The agent already emits tool_start, tool_result, status, and cancelled events through SSEOutputHandler — this PR wires those events to three new dashboard components so the user can see what the agent is doing, watch cards stream in as they're classified, and cancel a run mid-flight if needed.

Linked issue

Closes #1015

Changes

  • Add useSSEProgress hook subscribes to the dashboard's existing SSE connection and fans state out to consumers; no new event types introduced
  • Add ProgressStrip shows current step in human-readable terms (tool_start → label map with fallback); displays count/percentage when the event carries pagination metadata
  • Add StreamingCards animates classified cards into the Surfaced column one-by-one as each tool_result arrives, instead of all-at-once at the end
  • Add CancelButton visible while a run is in-flight; POSTs to /api/cancel and clears on the existing cancelled SSE event
  • Add tool-name → human label mapping (pre_scan_inbox_impl, draft_reply, fetch_calendar; generic fallback for any other tool)
  • Wire per-tool latency timestamps into the existing perf hook (coordinates with feat(agents): multi-model parallelism — small classifier + large writer via Lemonade multi-model loading #1000 sub-issue 8 - no double-instrumentation)
  • SSEOutputHandler is unchanged

Test plan

  • python util/lint.py --all passes
  • pytest tests/unit/ passes
  • Trigger a dashboard refresh against a 25-message inbox confirm ProgressStrip updates step label on each tool_start and shows a message count during classification
  • Confirm cards stream into the Surfaced column incrementally (visible one-by-one, not all at once)
  • Click Cancel mid-run confirm the run stops within ~1 s and partial results remain visible
  • Trigger a draft or calendar refresh confirm the strip and cancel button work for those tools too (not just pre_scan_inbox)
  • Confirm no new SSE event types are emitted (event log should show only tool_start, tool_result, status, thinking, cancelled)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(email): Streaming progress UI for long-running Triage Dashboard runs

1 participant