Repository navigation
fix: switching agents can show another agent's auth and quota - #132894
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 29, 2026, 10:52 PM ET / August 30, 2026, 02:52 UTC. ClawSweeper reviewWhat this changesThe PR clears and reloads Control UI identity, model-authentication, quota, and sidebar-alert state when a selected or retained-session agent changes, rejecting delayed results for the previous agent. Merge readinessKeep open. This MEMBER-authored, Priority: P1 Review scores
Verification
How this fits togetherThe Control UI obtains agent-specific identity and model-authentication data from the Gateway, then displays it in chat and sidebar alerts. Agent selection and fixed-session routing determine which agent is allowed to publish that data. flowchart LR
A[Agent selection or route change] --> B[Chat ownership transition]
B --> C[Identity and auth requests]
C --> D[Agent and request-version fence]
D --> E[Chat identity and quota]
D --> F[Sidebar auth alerts]
E --> G[Control UI operator view]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource +49, Tests +461. Total +510 across 12 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the single transition owner for global selection and fixed-session replacement, then merge once the final head’s focused Control UI checks confirm the delayed-response flow. Do we have a high-confidence way to reproduce the issue? Yes—source-reproducible with high confidence: delay current main's Is this the best way to solve the issue? Yes. A single agent-owner transition is the narrowest maintainable repair because both global selection and retained fixed-session replacement must clear and refetch the same agent-owned presentation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3322b9552df8. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
074347e to
4063d94
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
fde36ed to
f1d2945
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
f1d2945 to
9f35578
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Fixed: Switching agents now keeps chat identity, authentication, quota, and sidebar alerts bound to the current agent. |
…aw#132894) Switching selected agents now clears and reloads agent-owned auth, identity, account, plan, and quota state. Delayed prior-agent responses and routine Gateway snapshots can no longer overwrite the current view, and sidebar authentication attention follows the same ownership while fixed sessions and reconnect behavior remain unchanged. Fixes openclaw#129215
Fixes #129215
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.
What Problem This Solves
Fixes an issue where users switching agents in a global Control UI chat could see the previous agent's account, plan, quota, identity, or authentication warning when an earlier request completed late.
Why This Change Was Made
Auth and identity results are now bound to the selected agent and request generation. Agent changes clear prior presentation immediately, start replacement loads, and reject stale completions while preserving fixed-session routing, reconnect fencing, and non-auth sidebar attention.
User Impact
The selected agent's chat and sidebar now show only that agent's authentication and quota state, including during delayed responses and routine Gateway presence updates.
Evidence
Before
Delayed Main responses overwrite the Work view with Main identity and quota data.
After
Work remains selected and only Work account, plan, provider, and quota data appear.
Recording
The recording shows the Main-to-Work switch, zero-row loading state, delayed Main settlement being ignored, and the final Work result.
selected-agent-auth-quota.webm
Exact candidate:
074347e2bead6c633b62f243267add778ea452b5Blacksmith Testbox:
pnpm test ui/src/pages/chat/chat-state.test.ts ui/src/e2e/chat-quota-pill-93041.e2e.test.ts: 105 chat-state tests and 5 quota E2E tests passed.pnpm test ui/src/components/sidebar-attention.test.ts: 35 tests passed.pnpm test ui/src/pages/chat/chat-pane-lifecycle.test.ts: 29 tests passed.pnpm check:changed: UI/core changed lanes passed formatting, guards, typechecks, and lint.The regression fails on the frozen base and passes on the exact candidate. Test coverage was audited rather than duplicated: one obsolete sidebar case was absorbed into the stronger ownership matrix, six existing declarations were strengthened, and two runnable chat cases were added for stale success and failure.