webui: one multiplexed live stream per client #992

Closed
opened 2026-10-27 13:38:35 +00:00 by sam · 0 comments
Owner

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 93446477


Imported from beads archie-core-1ccs · GitHub #1002 · type feature · priority P1 · created 2026-09-25 · closed 2026-09-26

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 93446477 --- _Imported from beads `archie-core-1ccs` · GitHub #1002 · type feature · priority P1 · created 2026-09-25 · closed 2026-09-26_
sam added the highfeature labels 2026-10-27 13:38:35 +00:00
sam self-assigned this 2026-10-27 13:38:35 +00:00
sam closed this issue 2026-10-27 13:38:36 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: sam/archie#992