Repository navigation
fix: keep restored Usage navigation from being replaced by Chat - #137402
Conversation
Read current router state when an earlier subscriber starts another navigation during notification. Remove the duplicate selector comparison and retain the outlet presentation and recovery lifecycle.
|
Codex review: blocked before merge. Reviewed September 3, 2026, 6:58 PM ET / 22:58 UTC. ClawSweeper reviewWhat this changesThe PR makes the Control UI route outlet read the router’s current state during notifications so stale not-found recovery cannot replace a remembered Usage page with Chat. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 4 items remain Keep this maintainer-authored PR open. The focused outlet change and regression test match the linked startup-navigation defect, but merge remains blocked on real macOS/Gateway behavior proof and independent confirmation of the router notification contract. Priority: P1 Review scores
Verification
How this fits togetherThe Control UI router publishes route-state changes to the outlet controller, which renders pending or active pages and recovers unavailable routes. During native dashboard startup, the shell can restore a remembered page before the outlet decides whether recovery is needed. flowchart LR
A[Native dashboard startup] --> B[Restore remembered route]
B --> C[Router notification]
C --> D[Shell route restoration]
C --> E[Route outlet controller]
D --> F[New route navigation]
F --> E
E --> G{Current state unavailable?}
G -->|No| H[Render remembered page]
G -->|Yes| I[Recover to Chat]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -11, Tests +52, Docs +5. Total +46 across 3 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 generic outlet-level current-state read, then attach redacted real Gateway/macOS startup evidence and the router-contract evidence needed to validate the ordering assumption. Do we have a high-confidence way to reproduce the issue? No independently verified current-main reproduction was possible here: the focused test expresses the exact subscriber-order scenario, but the real router package could not be inspected or run in this read-only environment. Is this the best way to solve the issue? Yes, provisionally: the outlet owns not-found recovery and its caller can initiate a newer navigation first, so reading current router state prevents the stale snapshot from driving recovery. Direct router-contract and current-main confirmation remain outstanding. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8c6653a78dec. 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
History |
|
Merged via squash.
|
…date-command * origin/main: fix(ci): retry transient npm advisory timeouts (#137716) fix: keep restored Usage navigation from being replaced by Chat (#137402) fix: keep Usage day totals within the selected session scope (#137396) refactor: reduce live digest scheduling allocations (#137655) fix(ui): submit selected slash arguments in new sessions (#137571) fix(ui): expand collapsed task progress on final (#137569) fix(test): prevent auth discovery from stalling MCP replacement proof (#137639) test(cli): reuse canonical directory mock call helper (#137640)
…claw#137402) Remembered Usage now stays open when dashboard startup starts a replacement navigation inside a router notification. The route outlet reads current router state, preventing an obsolete not-found snapshot from scheduling Chat recovery. Remove the duplicate selector equality helper and retain the existing presentation/recovery owner. Native route memory, explicit deep links, pending-page retention and first-run setup policy remain unchanged. Net production change: -11 lines. Verified real uirouter subscriber ordering, failing original-owner regression, 118 sibling tests, fresh independent review and exact-head CI. Real Gateway/production UI browser proof reproduces the baseline Chat overwrite and verifies retained Usage plus explicit-session transcript controls. Native bridge is simulated in explicitly authorized isolated Chromium; the signed macOS/WebKit app was not exercised. Fixes openclaw#137391.
Closes #137391
What Problem This Solves
Fixes an issue where the native dashboard briefly restored remembered Usage, then jumped back to Chat during startup.
Why This Change Was Made
An earlier router subscriber can start another navigation while a not-found notification is still being delivered. The outlet consumed the obsolete outer snapshot after seeing the newer navigation and queued Chat recovery. It now reads the router's current state on notification, using its existing publication comparison instead of a second selector comparison.
This repairs the shared route-presentation owner. Native route memory, explicit deep links, first-run setup, pending-page retention and recovery readiness retain their existing policies. No dependency or persistent preference changes.
User Impact
Remembered Usage stays open. A navigation started by an earlier subscriber is no longer overwritten by recovery from a superseded route.
Evidence
Final exact-head CI run passed.
@openclaw/uirouter0.1.1 fails on main with an obsolete not-found callback while the replacement route is already loading; it passes after the repair.Live Gateway verification now passes on the exact head in explicitly authorized isolated Chromium. The Gateway uses canonical synthetic SQLite sessions, the real connection/route lifecycle, and its production UI; no transport mocking or provider calls. Document-start native bridge markers are simulated. This is not a signed macOS/WebKit application test.
/chat/chat/main; overwrites remembered route to Chat/usage?agent=main; remembers Usage/chat/main/qa/usage-openaiAll four observations pass with unchanged source/bundles and verified served JavaScript hashes. The remembered-route cases have zero page, console or HTTP errors. Each explicit-session control records one intentional missing-workspace-icon 404 and verifies the documented visible folder fallback; there are no unexpected errors. The synthetic profile and screenshots were inspected before publication.
Before: remembered Usage is overwritten by Chat
After: remembered Usage remains open
Direct dependency inspection confirmed
@openclaw/uirouter0.1.1: installeddist/index.js:204–216capturesnext = readState()before iterating its listener set synchronously;dist/index.js:345–354applies selectors to that delivered snapshot. Source SHA-256:3f4179f5ff957232e5067142cdb0c40ca3d5cd1c77c006a38be1d52b434b58bb. The real-router regression records this ordering:Fresh main
cd8c74889d21ddcc9f3a2d47fe868224a0e44acbstill has the identical outlet owner as the reproduced baseline. The maintainer personally inspected the dependency and current-main source, closing the review environment's source-access gaps.ClawSweeper disposition: the real Gateway before/after media and direct notification-order evidence above address both rank-up moves and the requested proof/contract follow-ups. The macOS binary remains untested; the user explicitly authorized isolated Chromium for this completion, and the changed owner is the shared browser outlet, with native/setup policy unchanged. The fresh independent complete-branch Codex review is clean through P2. Its evidence resolves the confidence gaps; a new ClawSweeper rating is not an enforced review rule or a prerequisite under the repository's fresh-review policy.