One Channel Plan — WRONG (what I actually built)
Date: 2026-04-06 Status: REVERTED — this was a patch, not a fix
What the plan said
One channel per client. Dashboard = dash-ws. Chat = SSE. Per-bot WS = request-response only.
What I actually built
Three phases that ended up with THREE channels again:
Phase 1 (commit 92380970)
- Added
broadcastToBot('chat-delta', ...)andbroadcastToBot('chat-status', ...)to dash-ws - Dashboard
use-chat.tslistens to dash-ws for streaming - Problem: Added MORE events to dash-ws instead of consolidating to one channel
Phase 2 (commit 52fbdace)
- Added SSE handler for chat events in chat frontend
main.ts - This part was fine — chat uses SSE, which is correct
Phase 3 (commit 527d1e41)
- Removed
sendToWebchatfromemitBotEvent - This part was fine — per-bot WS no longer gets server-push events
Result: still 3 channels
| Client | Channels | Problem |
|---|---|---|
| Dashboard | dash-ws + SSE + per-bot WS | Same mess as before, just different events on each |
| Chat | SSE + per-bot WS | SSE for events, WS for request-response (OK) |
Why this was wrong
I patched. "dash-ws already works, let me add events to it" instead of building the one channel the plan called for. The dashboard should read from SSE like chat does. dash-ws should not exist as a real-time event channel.