fix(desktop): give the gateway reconnect loop an escape hatch - #52189
Merged
Merged
Conversation
When a remote gateway dropped after a healthy boot (internet loss, sleep/wake, VPS restart), use-gateway-boot retried with backoff forever and never surfaced an error. The renderer sat behind the fullscreen CONNECTING overlay with gatewayState non-open and boot.error null — no way to reach Settings, sign in again, or switch to a local gateway. To the user the app was simply broken on connection loss. Raise a recoverable boot error once the reconnect loop crosses RECONNECT_ESCALATE_AFTER (6 attempts, ≈45s), so the BootFailureOverlay (Retry / Sign in / Use local gateway) replaces the dead-end CONNECTING screen. The loop keeps retrying underneath; the next successful reconnect (or a manual/wake-driven one) clears the error and dismisses the overlay. This implements the contract already specified — but never wired up — in use-gateway-boot.test.tsx (desktop vitest isn't in CI, so the failing "FIX:" specs went unnoticed). All 4 hook tests + the 3 connecting-overlay tests pass.
OutThisLife
enabled auto-merge
June 25, 2026 00:03
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
…fline fix(desktop): give the gateway reconnect loop an escape hatch
habarmc1223-sudo
pushed a commit
to habarmc1223-sudo/hermes-agent-fluxmem
that referenced
this pull request
Jul 8, 2026
…fline fix(desktop): give the gateway reconnect loop an escape hatch
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
…fline fix(desktop): give the gateway reconnect loop an escape hatch
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
…fline fix(desktop): give the gateway reconnect loop an escape hatch
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
…fline fix(desktop): give the gateway reconnect loop an escape hatch
melon-xf
added a commit
to melon-xf/hermes-agent
that referenced
this pull request
Sep 3, 2026
…fline fix(desktop): give the gateway reconnect loop an escape hatch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
"If you lose connection to the internet the app seems to break."
When a remote gateway drops after a healthy boot (internet loss, sleep/wake, VPS restart),
use-gateway-bootretried with exponential backoff forever and never raised an error. The renderer stayed behind the fullscreen CONNECTING overlay withgatewayStatenon-open andboot.errornull — so Settings, "sign in again", and "use local gateway" were all unreachable. The app looked bricked until a manual restart.Fix
Once the reconnect loop crosses
RECONNECT_ESCALATE_AFTER(6 attempts, ≈45s), raise a recoverable boot error so the BootFailureOverlay (Retry / Sign in / Use local gateway) replaces the dead-end CONNECTING screen. The backoff keeps retrying underneath; a successful reconnect — or a manual/wake/online nudge — resets the counter and clears the error.One new i18n string (
boot.errors.gatewayConnectionLost) across all four locales.Why this was sitting unfixed
apps/desktop/src/app/gateway/hooks/use-gateway-boot.test.tsxalready specifies this exact behavior with twoFIX:tests — but the desktop vitest suite isn't run in CI (CI only typechecks + builds the renderer), so those specs were red and nobody noticed. This change makes them green.Scope
This addresses the remote-disconnect "stuck on CONNECTING" dead end. The related "a turn's
$busy/working state never clears after a drop" is handled separately (session loop-guard).Test plan
vitest run --environment jsdom apps/desktop/src/app/gateway/hooks/use-gateway-boot.test.tsx— 4/4 pass (incl. bothFIX:specs).vitest run --environment jsdom apps/desktop/src/components/gateway-connecting-overlay.test.tsx— 3/3 pass.tsc -p apps/desktop --noEmit;eslint(no new issues).