fix(sse): heartbeat every 15s so the dashboard conn pill stops flapping #128
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!128
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/sse-heartbeat"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Symptom
Dashboard's connection pill flips
connected → disconnected → connectedevery 20-30s even when the service is healthy.Root cause
handleEventsopens the SSE stream and sends a singleinitmessage, then stays silent until a real event happens. Idle periods are common (no dispatches, no webhook traffic). After ~30s of no bytes, proxies / browsers / OSes drop the TCP connection;EventSourceauto-reconnects, and the UI flaps.Fix
Enqueue
: heartbeat\n\n(an SSE comment line — ignored by the client) on every connected controller every 15s. Keeps intermediaries happy, no UI-visible traffic. Silently prunes dead controllers ifenqueuethrows.16 lines in
src/main.ts; no test needed — this is an observable behaviour, not a logic branch.Verification
After merge + service restart: open
/dashboard, leave it idle for 2 minutes — conn pill stays green throughout.