fix(desktop): Bot Chats no longer stick as running after a gateway restart (salvage #93222) - #93292
Merged
Conversation
…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.
Contributor
૮ >ﻌ< ა ci reviewran on bbcecac — fix(desktop): rebind legacy-remote-primary Bot tiles via liv
|
This was referenced Aug 23, 2026
2 tasks
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.
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
connectionIdnow 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:resetTileRuntimeBindingstakes 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 addsUnknownRuntimeReconnectScope: 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 passesprimaryRuntimeConnectionId(conn), falling back to{ liveConnectionIds: liveSecondaryConnectionIds() }for legacy remotes.store/gateway.ts: secondary reconnect scopes the reset to{connectionId, profile}; newliveSecondaryConnectionIds()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-timesession not foundrecovery rebinds the tile viapatchSessionTileand never touches the foreground session id.Validation
tsc -p tsconfig.json)Related
Infographic