Skip to content

fix(web): recover stalled live streams - #34

Merged
sppidy merged 1 commit into
mainfrom
codex/live-stream-recovery
Aug 14, 2026
Merged

fix(web): recover stalled live streams#34
sppidy merged 1 commit into
mainfrom
codex/live-stream-recovery

Conversation

@sppidy

@sppidy sppidy commented Aug 14, 2026

Copy link
Copy Markdown
Owner

What changed

  • add an application-visible directory heartbeat to the UI WebSocket
  • bound opening handshakes and stale live links, with reconnects on visibility and network recovery
  • prevent retired socket generations from overwriting current agent state
  • reconcile the durable fleet every 30 seconds when SSE silently stalls
  • derive offline rows from the durable fleet identity/status instead of token hostname guesses

Root cause

Production agent-to-server mTLS links and durable snapshots remained healthy, but the browser control socket could become half-open after a tab or mobile-network transition. Browser JavaScript cannot observe protocol-level WebSocket Pong frames, so the provider had no freshness signal and could stay stuck. The offline sidebar fallback also guessed identities from token hostnames instead of using the durable fleet read model.

Impact

The dashboard now recovers live controls without a reload, keeps durable data bounded to 30 seconds of staleness if SSE gets stranded, and no longer marks healthy durable hosts offline because the UI socket dropped.

Validation

  • npm test — 15 files, 91 tests passed before final edge-case additions
  • focused provider/sidebar tests — 14 tests passed after final self-review
  • npm run typecheck
  • npm run lint — success; repository baseline warnings only
  • npm run build
  • production diagnosis confirmed all 5 agents on protocol 19 with heartbeat and snapshot ages under 5 seconds

@sppidy
sppidy marked this pull request as ready for review August 14, 2026 08:24
Copilot AI lite review requested due to automatic review settings August 14, 2026 08:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@sppidy
sppidy merged commit e240178 into main Aug 14, 2026
8 checks passed
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