webui: one multiplexed live stream per client #992
Notifications
Due Date
No due date set.
Blocks
Depends on
Reference: sam/archie#992
Reference in new issue
Block a user
Replace the per-concern EventSources with a single /api/stream per tab. Every frame carries a topic: task events (today's payload), control-plane resource updates (kind, version, value), identities changes, apply-status changes. Control-plane and identities updates are low-volume, so every client gets them without subscribing. Logs are high-volume, so they are opt-in: the client reconnects with ?topics=logs while the logs page is open (reconnect-on-change, resuming from the last seen cursor per topic via Last-Event-ID), rather than a second stream. Chat turns stay request-scoped POST responses; they end when the turn ends.
Server: internal/webui owns the frame format and one hub (the existing registerSSEConn fan-out in sse.go is the precedent). Client: stores/live-updates.ts becomes the only EventSource and dispatches by topic; stores/control-plane.ts, stores/identities.ts and logs/state.ts consume from it and open nothing themselves. Delete /api/control-plane/watch/{kind}, /api/identities/watch and /api/logs/stream once nothing calls them.
Acceptance criteria
grep finds exactly one 'new EventSource' in ui/src; per-topic reconnect/resume covered by tests against the real hub; the three per-concern endpoints are gone.
Close reason
Fixed in
93446477Imported from beads
archie-core-1ccs· GitHub #1002 · type feature · priority P1 · created 2026-09-25 · closed 2026-09-26