Skip to content

fix(desktop): give the gateway reconnect loop an escape hatch - #52189

Merged
OutThisLife merged 1 commit into
mainfrom
bb/desktop-offline
Jun 25, 2026
Merged

OutThisLife merged 1 commit into
mainfrom
bb/desktop-offline

Conversation

@OutThisLife

@OutThisLife OutThisLife commented Jun 24, 2026 •

Copy link
Copy Markdown
Contributor

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-boot retried with exponential backoff forever and never raised an error. The renderer stayed behind the fullscreen CONNECTING overlay with gatewayState non-open and boot.error null — 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.tsx already specifies this exact behavior with two FIX: 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. both FIX: 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).
  • Manual (remote gateway): kill connectivity → after ~45s the recovery overlay appears; restore → it reconnects and dismisses.

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.
@alt-glitch alt-glitch added type/bug Something isn't working comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have labels Jun 24, 2026
@OutThisLife
OutThisLife enabled auto-merge June 25, 2026 00:03
@OutThisLife
OutThisLife merged commit 4127332 into main Jun 25, 2026
21 checks passed
@OutThisLife
OutThisLife deleted the bb/desktop-offline branch 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants