Repository navigation
fix(ui): preserve selected session ownership in the composer - #133085
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 1:40 AM ET / 05:40 UTC. ClawSweeper reviewWhat this changesThe PR passes the chat pane’s ownership-validated session row to the composer and makes same-connection identity changes refresh the currently selected session roster rather than re-bootstrap the route default. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessNo concrete introduced correctness or security defect was found. This maintainer-authored, protected PR should remain open while an exact-current-main merge result and its in-progress checks are refreshed. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI chat pane resolves the active agent’s session from Gateway session data, including global aliases. The composer consumes that row to render context usage, goals, progress, and model-specific controls. flowchart LR
A[Gateway session roster] --> B[Chat pane]
C[Selected agent] --> B
B --> D[Ownership-checked session row]
D --> E[Chat view]
E --> F[Chat composer]
F --> G[Usage goals and thinking controls]
A --> H[Identity update]
H --> I[Roster refresh coordinator]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +8, Tests +84, Docs +1. Total +93 across 11 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the single ownership-validated session flow and complete exact-current-main CI before maintainer merge review. Do we have a high-confidence way to reproduce the issue? Yes, from source: a global alias can resolve to a canonical row while raw key-only searches cannot, and the new tests exercise both the alias and mismatched-owner cases. This read-only review did not execute the browser scenario. Is this the best way to solve the issue? Yes: carrying the pane’s already ownership-validated row removes duplicate consumer resolution, while the roster coordinator remains the single refresh owner for identity events. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5553615584dc. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
|
@clawsweeper re-review Linux CI reproduction exposed the producer side of the same ownership defect after the original review: presence identity hydration replaced a selected or queued agent roster with the default agent. The new commit routes identity-only updates through the existing event coordinator and retains bootstrap for new connections. Both regression orders and all 497 session tests pass; the full changed-file gate and managed P2 review pass. The PR body records the intentional changelog disposition and browser proof status. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
…w#133085) * fix(ui): preserve selected session ownership in the composer * fix(ui): preserve roster intent when operator identity arrives
Summary
The chat composer can lose its usage ring and model-specific
/thinkoptions after switching agents in global-session mode. The pane resolves the selected session correctly, but the composer repeats a key-only search through the raw session list. That search misses global aliases and can also revive a stale global row the pane rejected for belonging to another agent.Carry the pane's selected session through the chat view into the composer, and delete both duplicate row searches. Context/quota, goal/progress presentation, and thinking arguments now consume the same selected row. An absent selected row stays absent. There are no configuration, protocol, dependency, persistence, or locale-output changes.
The existing delayed-agent browser regression now uses the real agent picker, consistent global-scope fixtures, and held metadata responses released by exact captured request IDs. It still asserts that delayed Main auth/identity never replaces Work and that the final popover shows Work's account, plan, and quota. Direct-render fixtures now provide the selected row explicitly.
A Linux replay also exposed the upstream producer race: operator identity arriving through presence rehydrated the default Main roster after the picker had selected Work. Identity-only updates now use the existing event-refresh coordinator, preserving both an active query and a queued picker change. New/reconnected clients still bootstrap from the gateway route. This removes the misuse of connection bootstrap for identity events without adding a second refresh owner.
Verification
/thinkcase passed while the global alias failed. The real picker flow failed on the missing final ring after Work auth had loaded.After merging current main, the only conflict preserved both our held-request fixture and upstream's synthetic OpenAI transcript. The integrated tree passed 819 session/composer/view tests, all five real Chromium quota cases, and another independent P2 review. Hosted CI33294969496 passed for head
52bafb43c5f7ac9c19b00e489e76e81acf4a9696, including the required CI gate. To resolve the latest review's unavailable-main-source limitation, I fetched and tested GitHub's proposed merge25285007ebf9139117412c21111e30a89ed56813(parentsd5672464f2e8da81e04ef9f2818ac51a259daf50and this head): 819 focused tests and all five Chromium quota cases passed again. The justified production delta retains one refresh coordinator and one selected-session owner; no separate maintainer repair remains.Scope and release note
Preserve selected-session ownership in the Control UI composer so global agent switches keep the correct usage, goal/progress, and thinking presentation. The docs also correct an existing stale-usage description: stale token totals remain approximate instead of disappearing.
Production delta is +19/-11 (+8 raw lines): six executable duplicate consumer lookup lines are removed, while the producer distinguishes identity events from connection bootstrap and reuses the existing coordinator. Type wrapping and invariant comments account for the remaining presentation lines. Test delta is +309/-225, largely parameterization indentation; docs +1/-1 and release note +1. No configuration, persistence, or protocol surface changes.
ClawSweeper rank-up disposition: the release-note removal suggestion is skipped under the maintainer's explicit task authorization to include changelog entries for user-facing landed fixes. This is a release-verification repair and the bullet is intentional. The earlier filtered-assertions feedback is addressed by the canonical selected-row tests plus the real picker and stale-response browser assertions; none are weakened.
Nearby follow-up: model-control/thinking-select helpers independently support raw-row lookup and New Session synthetic targets. Their ownership boundary needs a separate reproduction and caller audit; this PR does not claim to repair those controls.
Before / after
Synthetic fixtures only. Before: Work metadata has loaded but the usage ring is missing. After: the context window and Work account quota are available.