Repository navigation
fix(ui): preserve session updates after agent switches - #150305
Conversation
Reconcile completed operations without replacing the selected agent list. Use conversation permission facts to retire retained recovery choices.
|
🦞👀 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: blocked before merge. Reviewed September 16, 2026, 11:58 PM ET / September 17, 2026, 03:58 UTC (Revision 3). ClawSweeper reviewWhat this changesThe PR keeps session lists updating after agent switches and reconciles permission-picker recovery using fresh facts for the affected conversation. Merge readiness⛔ Blocked before merge - 2 items remain This repair remains useful: current main still lets completed batch operations replace the foreground query. The merged agent-switch performance work addresses a different problem. No actionable introduced correctness or security defect was found. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI receives session lists and updates from the Gateway. Its session capability reconciles those facts, while sidebar and chat controllers preserve the user's selected agent and conversation. flowchart TD
A[Session operation completes] --> B[Session reconciliation]
C[Selected agent and filters] --> D[Foreground list owner]
B --> E{Affected agent selected?}
E -->|Yes| D
E -->|No| F[Scoped session facts]
D --> G[Sidebar rows and pagination]
F --> H[Conversation controls]
D --> H
Before merge
Agent review detailsSecurityNone. PR surfaceSource +63, Tests +265, Docs 0. Total +328 across 48 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep foreground selection separate from operation reconciliation, with conversation-scoped permission freshness and errors owned by the affected view. Do we have a high-confidence way to reproduce the issue? Yes, source inspection supports holding a Main batch archive, switching to Research, then completing the archive and emitting a Research update. The supplied older browser comparison demonstrates that sequence; this review did not execute current main. Is this the best way to solve the issue? Yes. Reusing the existing mutation reconciliation owner repairs the foreground-query takeover without adding another cache, public API, or permission policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 035227797aa6. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
Keep the confirmed mutation outcome when an admitted read repeats the saved permission mode and timestamp. Move the refresh outcome type to its capability owner to remove the import cycle.
|
Merged via squash.
|
…1148) The Research fixture returned two rows for a 200-row query. A trailing refresh after pagination then replaced the appended rows with that short page. Seed a full first page and return the expanded retained window. Keep the named-row assertions and verify Active retains its expanded window while All starts a fresh page on agent re-entry. Related: #150505 (startup fixture extraction ruled out; the pagination fixture predates it in #149959 and #150305). Observed in main run 35272742639, checks-ui-e2e (10/13).
* fix(ui): preserve session updates after agent switches Reconcile completed operations without replacing the selected agent list. Use conversation permission facts to retire retained recovery choices. * fix(ui): retain permission refresh warnings after reads Keep the confirmed mutation outcome when an admitted read repeats the saved permission mode and timestamp. Move the refresh outcome type to its capability owner to remove the import cycle.
…nclaw#151148) The Research fixture returned two rows for a 200-row query. A trailing refresh after pagination then replaced the appended rows with that short page. Seed a full first page and return the expanded retained window. Keep the named-row assertions and verify Active retains its expanded window while All starts a fresh page on agent re-entry. Related: openclaw#150505 (startup fixture extraction ruled out; the pagination fixture predates it in openclaw#149959 and openclaw#150305). Observed in main run 35272742639, checks-ui-e2e (10/13).
What Problem This Solves
Fixes the session sidebar losing later updates when an operation finishes for another agent. For example, archive several Main sessions, switch to Research while the archive is pending, and Research can stop receiving new rows even though it remains selected.
User Impact
The selected agent keeps its session list, pagination, and ongoing updates while earlier operations settle. Permission, sharing, and worker actions reconcile the agent they changed without taking over the selected list. After a permission update fails, the picker adopts fresh permission data for that session; another agent's refresh cannot clear its retained choice.
Why This Change Was Made
Operation completion uses the existing mutation reconciliation owner, and the sidebar keeps its subscription bound to the expanded agent. Callers consume scoped refresh outcomes through their existing error owners. Permission recovery uses the existing conversation permission projection, including authoritative list and standalone session reads. A later read of identical saved values advances observation freshness while preserving the confirmed save outcome and its refresh warning. The capability also reuses the existing session-operation method group, with connection retirement and disposal kept private, instead of maintaining a duplicate forwarding list. Gateway, public plugin SDK, and permission-policy contracts are unchanged.
Evidence
c32a3181. Its initial composition passed 383 tests across 19 files; after the operation-group cleanup, 15 existing lifecycle cases across three files passed. These results retain their source scope and are not added to earlier overlapping proof. All 26 selected checks for the 48 authored files passed, plus MDX checks fordocs/gateway/permission-modes.mdanddocs/web/control-ui/chat.md. The final test-title-only edit passed formatting and exact body comparison. Fresh integration P2 review completed 18 passes with no findings.b31ad046with the sidebar repair: 11 passed / 1 failed before; 12 passed after. Active batch archive lost later Research updates. Rename, All-filter, bulk-delete and archive/Undo controls passed in both arms. The retained pictures below illustrate that source-qualified comparison, not a browser run of the newer integration.listRefreshError, while the acknowledgement-only and retained-choice controls passed. The repair preserves the confirmed save outcome and warning while allowing fresh observations to retire an uncertain displayed choice.The pinned
c32a3181tree still has an inherited Slack ingress/thread-resolution Madge failure. Its runtime value-cycle check passed; newer main contains the separatea13ecd23b32type-edge repair. The published2c45d857revision passed exact-head PR CI, and fresh exact-head CI remains required for this integration before landing. No assertions, deadlines, limits or gates were relaxed.Browser proof uses the registered Control UI with a synthetic mocked Gateway and fresh contexts. Source restoration and owned process, lease, claim and capsule cleanup are verified. No live Gateway or provider claim is made.
The sidebar before capture ends after the Research-update wait fails. The after capture completes the update, pagination and revisit, so elapsed state and toast visibility differ. The warning repair and internal type move preserve this sidebar flow; the identical warning captures remain executed-state evidence rather than a claimed visual difference.
Before
After