Skip to content

Feat/dashboard sse progress#1031

Closed
theonlychant wants to merge 5 commits intoamd:mainfrom
theonlychant:feat/dashboard-sse-progress
Closed

Feat/dashboard sse progress#1031
theonlychant wants to merge 5 commits intoamd:mainfrom
theonlychant:feat/dashboard-sse-progress

Conversation

@theonlychant
Copy link
Copy Markdown
Contributor

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)

- Restore except HTTPException: raise in documents.py to prevent
  OSError handler from swallowing upstream HTTP exceptions
- Replace bare except Exception: pass in _register_tools across
  chat, docqa, and fileio agents with specific ImportError/
  AttributeError catches that log and re-raise unexpected errors
- Fix mutable default: rag_documents Optional[list[str]] = None
  in docqa agent dataclass
- Expand test_agents_split.py to assert tool_registry contents
  after instantiation, not just that instantiation succeeds
@theonlychant theonlychant marked this pull request as draft May 11, 2026 02:06
@github-actions github-actions Bot added mcp MCP integration changes rag RAG system changes tests Test changes electron Electron app changes performance Performance-critical changes agents labels May 11, 2026
@theonlychant theonlychant deleted the feat/dashboard-sse-progress branch May 11, 2026 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents electron Electron app changes mcp MCP integration changes performance Performance-critical changes rag RAG system changes 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