Skip to content

fix(desktop): Bot Chats no longer stick as running after a gateway restart (salvage #93222) - #93292

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-72303138
Aug 23, 2026
Merged

fix(desktop): Bot Chats no longer stick as running after a gateway restart (salvage #93222)#93292
teknium1 merged 2 commits into
mainfrom
hermes/hermes-72303138

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Salvage of #93222 by @dokterdok

Summary

A persisted Bot Chat stays usable after its owning gateway or profile backend restarts — the tile drops its dead runtime binding, re-resumes on its own gateway, and no longer sticks as "running" while the sidebar already shows the finished reply.

Salvage of #93222 by @dokterdok (authorship preserved), plus one follow-up: legacy remote primaries without a registry connectionId now also rebind (the original commit fell back to preserve-everything for that connection shape, leaving the bug in place there).

Changes

  • store/session-states.ts: resetTileRuntimeBindings takes a reconnect scope — only the restarted connection's (or {connectionId, profile} secondary's) Bot tiles drop their runtime binding; sibling profiles and other gateways stay live. Follow-up adds UnknownRuntimeReconnectScope: when the restarted identity is unknown, preserve only Bot runtimes owned by provably-live secondary connections and let everything else re-resume.
  • app/gateway/hooks/use-gateway-boot.ts: primary reconnect passes primaryRuntimeConnectionId(conn), falling back to { liveConnectionIds: liveSecondaryConnectionIds() } for legacy remotes.
  • store/gateway.ts: secondary reconnect scopes the reset to {connectionId, profile}; new liveSecondaryConnectionIds() helper (open-socket registry connections).
  • app/chat/session-tile-actions.ts + session-tile.tsx + use-prompt-actions/submit.ts: tile actions receive the tile's owner-scoped requester instead of the ambient active-gateway hook; action-time session not found recovery rebinds the tile via patchSessionTile and never touches the foreground session id.
  • Tests for primary/secondary reconnect scoping, tile rebind-on-recovery, and the new unknown-identity fallback.

Validation

Result
Focused vitest (5 files: session-states, gateway-boot, connection-lifecycle, tile-actions, tile-attachments) 73/73 passed
Desktop typecheck (tsc -p tsconfig.json) clean
eslint on changed files 0 errors
Contributor UAT (from #93222) real two-gateway macOS restart, persisted Bot Chat resumed and replied

Related

Infographic

Bot Chat rebind after gateway restart

dokterdok and others added 2 commits August 23, 2026 16:05
…ion scoping

A legacy remote primary carries no registry connectionId, so the scoped
reconnect reset could not name the restarted owner and fell back to
preserving every owner-routed Bot tile -- leaving the restarted backend's
own Bot Chat bound to its dead runtime (the original bug, persisting for
that one connection shape).

Unknown identity now fails toward recovery instead: preserve only Bot
runtimes owned by provably-live secondary connections
(liveSecondaryConnectionIds()); everything else drops its binding and
re-resumes. A reset only costs a re-resume, so this is safe for the
preserved-set survivors and correct for the dead one.
@github-actions

github-actions Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on bbcecac — fix(desktop): rebind legacy-remote-primary Bot tiles via liv

⚠️ Warnings

OSV vulnerability scan · View job

7 known vulnerabilities found in pinned dependencies.

How to fix:

Review the findings in the Security tab. Update the affected dependencies if a patched version is available.


debug info

CI timings

CI timings · View report · View job

Wall time 2m16s vs 4m15s (-46.7%). 3 job(s) slower, 1 faster, 2 unchanged.

  • JS & TS checks / JS & TS checks: +28.0s
  • OSV scan / Scan lockfiles / osv-scan: +5.0s
  • Check no committed infographics / check-no-committed-infographics: -3.0s
  • Detect affected areas: +1.0s

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/*) P2 Medium — degraded but workaround exists sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants