Repository navigation
Conversation
A route restored before connect was registered with the provisional unowned scope while the mounted chat pane registers with the connected account scope, so the connection bootstrap coordinator never accepted the pane and held background work such as the sidebar sessions.list for the whole connection. Re-key the foreground route on Gateway snapshots.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesRecompute the restored chat route’s scoped identity on Gateway snapshots so transcript readiness releases sidebar session discovery. Example: Reopen the Control UI with two existing sidebar chats and restore the last chat.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR repairs a source-confirmed startup defect still present on current main, with relevant browser proof and no actionable findings. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Control UI binds router and Gateway facts to a connection bootstrap coordinator, which admits background session-list requests after the selected transcript is ready. flowchart TD
A[Restored chat route] --> C[Foreground route identity]
B[Gateway snapshots] --> C
C --> E[Connection bootstrap coordinator]
D[Ready chat pane] --> E
E --> F[Session list request]
F --> G[Sidebar chats]
Technical reviewBest possible solution: Land the focused route re-keying repair while preserving the existing transcript-first coordinator. Do we have a high-confidence way to reproduce the issue? Source confirms that a provisional route key can remain mismatched with the connected pane key; the supplied browser comparison exercises that failure and recovery, but no target code was executed during this review. Is this the best way to solve the issue? Reusing the existing route synchronizer at the Gateway snapshot boundary fixes the stale identity at its producer without bypassing transcript priority or introducing another scheduler. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a166c4931a40. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +3, Tests +83. Total +86 across 2 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 15, 2026, 1:56 PM ET / 17:56 UTC. |
|
Closing as superseded. Main landed the same repair in afecea8 (#179919): |
Closes #173095
What Problem This Solves
Fixes: on a cold start that restores the last chat route, the Control UI never requested
sessions.list. The sidebar then showed only the open chat until some other action, such as creating a chat, refreshed the list.Since #146591, the connection bootstrap coordinator holds background work, including the sidebar's session list, until the foreground chat pane reports a ready transcript. The pane is accepted only when its key equals the foreground route key. Both keys come from
resolveChatSnapshotKey, which prefixes the session key with the connection's account scope.On a cold start, the restored route resolves while the Gateway is still connecting, so
subscribeForegroundChatBootstrapregisters it under the provisionalscope:unowned:<n>prefix. The chat pane mounts after connect and registers under the connectedscope:["ws://…","<account>"]prefix. Nothing re-keyed the route after connect, so the two keys never matched. The pane was rejected, and background bootstrap stayed held for the life of the connection.User Impact
User impact: reloading or reopening the Control UI on a chat now lists every accessible chat in the sidebar once the restored transcript is ready. The selected transcript still loads first: the background queue is held until the pane is ready, exactly as before.
Why This Change Was Made
ui/src/app/bootstrap-location.ts:subscribeForegroundChatBootstrapalready subscribes to Gateway snapshots to synchronize the coordinator's client. It now also recomputes the foreground route key on each snapshot. A route restored before connect is therefore re-keyed with the connected account scope, which is the key the mounted pane uses.The route rules are unchanged:
The subscription moved below
synchronizeso the first snapshot can re-key the route.Evidence
Real Control UI, Windows 11, headless Edge.
mainc47f803vs this branch), with a fresh state dir and a local mock model./, and the client restores the last chat route itself.sessions.listsent in 20 smainc47f803chat.startupandboard.get, as in the report)Root-cause trace on
main, from temporary logging inconnection-bootstrap.ts(not committed):setForegroundRoutescope:unowned:1\u0000agent:main:dashboard:<id>setForegroundPane(ready: true)scope:["ws://127.0.0.1:28795","<account>"]\u0000agent:main:dashboard:<id>The pane was rejected, so
foregroundPendingstayedtrueand the backgroundsessions.listtask never started.Regression test in
ui/src/app/bootstrap-location.test.ts. It uses the real coordinator: the route resolves before connect, the Gateway then connects, the foreground key must equal the pane's connected key, and a queued backgroundsessions.listtask must run once the pane is ready.mainGates:
bootstrap-location.test.ts,connection-bootstrap.test.tsandbootstrap.test.tspass.pnpm tsgo:uiandpnpm tsgo:test:uipass.pnpm check:changedcould not run locally. Its Crabbox route downloads from github.com, which this network resolves to a private address, so CI covers it.