Files
t3code/apps
Theo BrowneandClaude Opus 5 83faf56b65 fix: make restart-aware reconnect work from every entry point
The restart overlay only worked in ChatView, but ServerUpdateAction also
renders in Settings → Connections. An update triggered there armed the
window and then nothing consumed it: no calm status, no fast reconnect,
and the window was never cleared — exactly the behavior this PR set out
to fix, still reachable from the other entry point.

The window lifecycle (reconnect pokes, and ending the window once its
restart has been seen through) moves out of ChatView into an app-level
hook mounted in AppRoot, since a restart outlives whatever view started
it. ChatView now only presents. The saved-backend rows in Settings get
the same calm treatment: status dot, tooltip, and a "restarting to
finish the server update" line instead of a connection error.

The retry cadence was also a hardcoded 2s with no cap, which is ~45
teardown/rebuild cycles across a 90s window for a server that never
returns. It now starts at 2s (the point is beating the supervisor's
1s→16s escalation), eases to 8s, and stops after 12 pokes, leaving
normal supervisor backoff in charge — the right end state for a server
that is not coming back.

Pacing and poke-eligibility are pure exported functions with tests;
verified by removing the cap, which fails the budget test.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-07-26 15:37:16 -07:00
..