Skip to content

Reconnect without reloading from the server overlay - #35

Draft
krystofwoldrich-agent wants to merge 1 commit into
expo:mainfrom
krystofwoldrich-agent:codex/reconnect-disconnection-overlay
Draft

krystofwoldrich-agent wants to merge 1 commit into
expo:mainfrom
krystofwoldrich-agent:codex/reconnect-disconnection-overlay

Conversation

@krystofwoldrich-agent

Copy link
Copy Markdown
Contributor

Summary

  • replace the page reload copy and action with an in-place Reconnect action
  • expose a manual device-list reconnect that cancels pending backoff, closes any stale socket, resets the retry delay, and opens a fresh connection immediately
  • preserve the existing automatic reconnect behavior and dashboard page state
  • cover both overlay wording and immediate manual reconnect behavior with tests

Testing

  • bun run lint
  • bun run typecheck
  • bun run test
  • bun run build

Follow-up considerations

  • Degrade by capability instead of blocking the whole dashboard. A lost device-list socket does not necessarily mean the active stream, controls, logs, or cached device snapshot are unusable. We could retain the last snapshot and active stream, disable only server-backed mutations, and show a less intrusive stale-connection banner.
  • Coordinate every server-backed channel. The device list is only one connection. Stream/control WebSockets, WebRTC signaling and ICE, logs and event streams, and the agent-interaction socket should be audited so a server restart can re-establish the whole connection graph through one recovery signal.
  • Retry on useful browser signals. In addition to backoff, retry immediately on online, window focus, or visibility restoration. Add jitter to automatic backoff and consider showing the next automatic attempt so repeated manual clicks are unnecessary.
  • Classify failures before choosing recovery. A small health and protocol-version handshake could distinguish a stopped server, a proxy that blocks WebSockets, an incompatible restarted server, and an unhealthy device backend. Most cases should reconnect in place; a true client/server version mismatch needs a separate update path rather than making reload the default advice.
  • Protect state across longer outages. Confirm which transient session data is worth retaining, make retried mutations idempotent, and add telemetry for disconnect reason, recovery time, and which channel failed so future work targets the actual failure modes.

Co-authored-by: Krystof Woldrich <31292499+krystofwoldrich@users.noreply.github.com>
Co-authored-by: Codex <codex@openai.com>
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.

1 participant