Skip to content

feat(web): show swarm agent status in chat#188

Merged
warren618 merged 1 commit into
HKUDS:mainfrom
BillDin:codex/swarm-chat-agent-status
Jun 8, 2026
Merged

feat(web): show swarm agent status in chat#188
warren618 merged 1 commit into
HKUDS:mainfrom
BillDin:codex/swarm-chat-agent-status

Conversation

@BillDin

@BillDin BillDin commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Bridge swarm runtime events into the session SSE stream so chat can show live per-agent status.
  • Add an inline chat SwarmStatusCard with frontend state hydration from live events and final run_swarm results.
  • Fix the Vite dev proxy default to 127.0.0.1 to avoid Windows localhost resolving to ::1 while the API binds IPv4.

Why

The terminal swarm dashboard already shows each agent's waiting/running/done/failed/blocked/retry state, but the web chat only showed the top-level run_swarm tool as a long-running tool. This PR brings the same status visibility into the chat timeline and keeps the existing swarm page/API wire shape intact.

Changes

  • Inject the session event callback into SwarmTool and emit swarm.started / swarm.event frames through session SSE without changing /swarm/runs or /swarm/runs/{id}/events.
  • Add SwarmRunStatus / SwarmAgentStatus frontend types, a swarm event reducer, and an inline SwarmStatusCard in the chat timeline.
  • Hydrate a completed/failed card from the final run_swarm tool result for reconnect/history scenarios.
  • Add focused frontend coverage for status rendering and event normalization.
  • Default the frontend dev proxy to http://127.0.0.1:8899.

Test Plan

  • Existing tests pass (pytest --ignore=agent/tests/e2e_backtest --tb=short -q)
    • Ran .venv\Scripts\python.exe -m pytest --ignore=agent/tests/e2e_backtest --ignore=agent/tests/test_e2e_harness_v2.py --tb=short -q: 3057 passed, 2 skipped; 6 failed and 9 errored due to local Windows-only environment issues outside this change: symlink privilege errors in agent/tests/factors/test_registry.py, Windows chmod mode assertions in agent/tests/test_oauth_token_cache.py, and cache-home path expectations in agent/tests/test_loader_retry_helpers.py.
  • New tests added (if applicable)
    • .venv\Scripts\python.exe -m pytest agent/tests/test_swarm_status_hydration.py agent/tests/test_swarm_worker_report.py -q (32 passed)
    • cd frontend && npm run test:run -- SwarmStatusCard (5 passed)
  • Tested manually (describe below)
    • cd frontend && npm run build passed.
    • Manual local smoke: backend health and Vite proxy were checked after changing the dev proxy default to 127.0.0.1.

Checklist

  • No changes to protected areas (src/agent/, src/session/, src/providers/) without prior discussion
  • No hardcoded values (API keys, file paths, magic numbers)
  • Code follows CONTRIBUTING.md guidelines
  • Documentation updated (not applicable: chat UI behavior is covered by tests and no docs page currently describes chat status cards)

Signed-off-by: Chengcheng Ding <billdin1999@gmail.com>
@warren618 warren618 merged commit 71c4620 into HKUDS:main Jun 8, 2026
warren618 added a commit that referenced this pull request Jun 8, 2026
06-07 live swarm status in chat (#188) + preset routing (#189); 06-08 one-pull GHCR image (#187) + Gemini 3.x dict-path fix (#184). Older 06-05/06-04 folded into Earlier news to keep 3 visible.
@warren618

Copy link
Copy Markdown
Collaborator

Merged — really nice work. Bridging runtime events into the session SSE stream without changing the /swarm/runs shape was the right call, and rehydrating a finished card from the final run_swarm result covers the reconnect/history path cleanly. Appreciate the focused tests on both the live-event and no-session cases. 🙏

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants