Repository navigation
fix(control-ui): keep the sidebar stable across deep-link reloads - #168206
Conversation
|
🦞👀 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. What this changesThis PR restores sidebar presentation and initial session-routing facts from one scoped browser snapshot before live data arrives. Example: Reload Project dashboard 6 while Gateway hello is delayed.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep this useful PR open; its unified snapshot remains distinct from main, but the previously reported live-handoff defect still blocks merge. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe Control UI projects Gateway sessions, agents, presence, and plugin navigation into the sidebar and stores scoped display and routing facts in its browser snapshot database. flowchart TD
A[Gateway live data] --> B[Session and presence owners]
B --> C[Sidebar projection]
C --> D[Shared snapshot database]
D --> E[Scoped boot admission]
E --> F[Sidebar and route rendering]
B --> F
Technical reviewBest possible solution: Keep one scoped browser snapshot whose live handoff follows the current presence/count owner and preserves existing browser state through upgrade. Do we have a high-confidence way to reproduce the issue? The supplied browser comparison demonstrates the reload problem, and the inspected production owners establish the cached-presence/live-count mismatch; no target code was executed. Is this the best way to solve the issue? Sharing the existing snapshot database removes competing cache lifecycles, but readiness must follow authoritative live presence rather than retained display membership. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5b5a476b836e. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +889, Tests +1476, Docs +2. Total +2367 across 72 files. Added test files: 6. 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 HistoryReview history (23 earlier review cycles; latest 8 shown)
Reviewed October 10, 2026, 11:14 PM ET / October 11, 2026, 03:14 UTC (Revision 24). |
5c4c18d to
b0629a8
Compare
b0629a8 to
331ce3c
Compare
5c628e2 to
3cacc1d
Compare
3cacc1d to
fd412e5
Compare
c269cfc to
7040f0d
Compare
|
Landed with an admin squash merge pinned to the reviewed head The only failing test on this head was |
…enclaw#168206) One boot snapshot in the existing chat-snapshot IndexedDB database now owns the settled sidebar projection, primary session rows, routing defaults, and initial-read settlement, so pre-hello routing, the first header, and the sidebar paint from the same cached owner and the sidebar no longer reshuffles as roster, pins, and plugin rows arrive. Deletes the five legacy session-roster-cache modules and their separate database (best-effort deletion of openclaw-session-roster). Cached rows stay display-only and scoped per gateway/profile/agent filter; actions keep live authority. Regenerates ui/config/control-ui-boot-modules.json.
## What Problem This Solves An aborted IndexedDB transaction could report that an account-scoped chat snapshot clear succeeded, even though its cached records remained. ## User Impact Explicit scope clearing now reports transaction errors. Ordinary single-session cache eviction remains best effort. No schema, rendered UI, config, or protocol changes. ## Why This Change Was Made Use the existing transaction completion owner instead of treating complete, error, and abort as equivalent success events. The narrow regression uses a real IndexedDB transaction abort and verifies the record was not deleted. ## Best-effort tradeoffs accepted - Single-session eviction remains intentionally best effort; explicit scope clearing rejects on failure. No new best-effort concession is introduced. The swallowed transaction outcomes originated in #162428 and survived #167780/#168206; the regression demonstrates the bug without claiming a human incident. Net production LOC: **2 removed**. This is a silent-failure bug fix, exempt from the cleanup batch floor. ## Evidence - Before repair: the scope-clear regression failed because its promise resolved instead of rejecting; the single-session control passed. - After repair: 23 tests passed across the new invalidation regression and the existing snapshot store suite. New regression bodies: 6 ms; loaded-host wrapper: 167.37 s (Vitest 112.44 s). - Formatting and `git diff --check` pass. - Independent P0-P2 review found no issue in this packet. The complete multi-packet review found one unrelated MCP diagnostic issue, corrected separately. - Targeted production and regression graph typecheck passes, including after the fixture lint repair. Runtime import cycles: zero. Production import edges are unchanged, so this cut cannot add a static import component. The full madge scan was stopped after30minutes without a result; no full static scan pass is claimed. - Changed-file check: conflict-marker and line-cap gates pass. Max-lines itself passed but its combined command failed on inherited environment-count ratchet drift (452 variables, budget453). The subsequent broad assertion scan was deliberately stopped after the aggregate command exceeded20minutes; no passing aggregate check is claimed. - Lint-suppression test:2/3 pass, existing inventory mismatch96vs94 in untouched `ui/src/test-helpers/control-ui-streaming-reply.ts` (no-unnecessary-type-conversion and unbound-method, two each). No baseline/suppression changes. Exact-head hosted CI remains the broad gate. - Targeted source-backed lint found one unbound-method reference in the regression. The fixture now binds the native method to its test database; no suppressions were added. The fixed graph typecheck and affected two-case regression pass (120.26s wrapper /71.77s Vitest; bodies435ms). No fixed-head lint pass is claimed; exact-head hosted lint is required before merge. The change does not modify rendering; behavior is proved at the IndexedDB boundary. Exact-head hosted CI run38824831588 completed with the ci-gate successful; no failed jobs, CI reruns, dispatches or green-only pushes. Hosted lint supplies the fixed-fixture lint gate. Earlier draft-only skipped CI is not counted as proof.
## What Problem This Solves An aborted IndexedDB transaction could report that an account-scoped chat snapshot clear succeeded, even though its cached records remained. ## User Impact Explicit scope clearing now reports transaction errors. Ordinary single-session cache eviction remains best effort. No schema, rendered UI, config, or protocol changes. ## Why This Change Was Made Use the existing transaction completion owner instead of treating complete, error, and abort as equivalent success events. The narrow regression uses a real IndexedDB transaction abort and verifies the record was not deleted. ## Best-effort tradeoffs accepted - Single-session eviction remains intentionally best effort; explicit scope clearing rejects on failure. No new best-effort concession is introduced. The swallowed transaction outcomes originated in openclaw#162428 and survived openclaw#167780/openclaw#168206; the regression demonstrates the bug without claiming a human incident. Net production LOC: **2 removed**. This is a silent-failure bug fix, exempt from the cleanup batch floor. ## Evidence - Before repair: the scope-clear regression failed because its promise resolved instead of rejecting; the single-session control passed. - After repair: 23 tests passed across the new invalidation regression and the existing snapshot store suite. New regression bodies: 6 ms; loaded-host wrapper: 167.37 s (Vitest 112.44 s). - Formatting and `git diff --check` pass. - Independent P0-P2 review found no issue in this packet. The complete multi-packet review found one unrelated MCP diagnostic issue, corrected separately. - Targeted production and regression graph typecheck passes, including after the fixture lint repair. Runtime import cycles: zero. Production import edges are unchanged, so this cut cannot add a static import component. The full madge scan was stopped after30minutes without a result; no full static scan pass is claimed. - Changed-file check: conflict-marker and line-cap gates pass. Max-lines itself passed but its combined command failed on inherited environment-count ratchet drift (452 variables, budget453). The subsequent broad assertion scan was deliberately stopped after the aggregate command exceeded20minutes; no passing aggregate check is claimed. - Lint-suppression test:2/3 pass, existing inventory mismatch96vs94 in untouched `ui/src/test-helpers/control-ui-streaming-reply.ts` (no-unnecessary-type-conversion and unbound-method, two each). No baseline/suppression changes. Exact-head hosted CI remains the broad gate. - Targeted source-backed lint found one unbound-method reference in the regression. The fixture now binds the native method to its test database; no suppressions were added. The fixed graph typecheck and affected two-case regression pass (120.26s wrapper /71.77s Vitest; bodies435ms). No fixed-head lint pass is claimed; exact-head hosted lint is required before merge. The change does not modify rendering; behavior is proved at the IndexedDB boundary. Exact-head hosted CI run38824831588 completed with the ci-gate successful; no failed jobs, CI reruns, dispatches or green-only pushes. Hosted lint supplies the fixed-fixture lint gate. Earlier draft-only skipped CI is not counted as proof.
What Problem This Solves
A signed-in reload of a dashboard deep link rebuilt the sidebar in stages. The campaign's original observation recorded 14 visible states over roughly 15 seconds; the selected row moved from slot 5 to slot 11. The original synthetic reproduction recorded 14 sidebar states and 10 selected-row movements.
User Impact
On reload the sidebar now paints once in its settled shape (synthetic proof on current main: 4 → 1 sidebar states, zero pinned-row movement; original reproduction 14 states and 10 selected-row movements) instead of reshuffling as roster, pins, and plugin rows arrive. Pre-hello routing and the first header read the same cached owner, so the page no longer shows interim session-group lists or an "Owner · Connecting…" footer when a cached profile exists.
Why This Change Was Made
One boot snapshot in the existing chat-snapshot IndexedDB database now owns the settled sidebar projection, primary session rows, routing defaults, and initial-read settlement. Pre-hello routing, the first header, and the sidebar share that owner. Connection or retirement releases routing waiters even when IndexedDB stalls.
Deleted all five legacy
session-roster-cache*production modules (752 lines), their separate database lifecycle, and obsolete tests. Database version 6 starts best-effort deletion ofopenclaw-session-roster. Existing scope invalidation, 30-day expiry, eight-projection pruning, and 512 KiB record bound stay with the snapshot owner. No Gateway schema, durable server shape, config option, or protocol changes.Main's compact personal navigation rail landed during this refresh. The snapshot also records its selected view, scope-switch visibility, dashboard rows, and resolved pin presentation. Missing personal references remain placeholders. A saved Pages catalog is admitted only for its exact nullable agent filter; selected-chat changes do not invalidate an all-agent Pages catalog. Cached rows stay display-only, actions retain live authority, the footer keeps truthful connection status, and chip snapshots are admitted only for their saved agent. Live handoff happens before rendering; persistence happens after the live render.
Evidence
Full UI e2e on the final head: 3,361 passed, 1 failed, 1 configured skip across 738 files; the single failure (Workboard native bundle overlay focus) reproduces on main 73f2255. Hosted CI on the exact head passed types, lint, guards, and all UI unit shards; checks-ui-e2e (4/9) failed only on that inherited Workboard test and fail-fast cancelled (7/9), whose files passed in the full local run. Details below.
Measurements and screenshots
The current-main comparison uses the same synthetic scenario on
53b811864752, after the rail migration:The rail already fixes the old selected-row movement. This change removes its remaining empty roster/placeholder identity sequence. The earlier pre-rail synthetic comparison was 14→1 states and 10→0 selected-row movements; it is a different layout and is not mixed into the current numbers. These are sidebar state/geometry measurements, not whole-page CLS or load-time claims.
Before hello on current main:
Before hello with the unified snapshot:
All captures use synthetic data and were inspected. No private campaign capture was uploaded.
Manifest
Regenerated with
pnpm ui:boot-manifest:genunder the approved host-load limit; generated changes are separatebuild(control-ui): regenerate boot module manifestcommits. No handwritten JSON changes. Both the deleted roster-cache modules and the lazy readiness adapter are absent.The generator now disables the mock's automatic roster-readiness probe: that diagnostic read otherwise imports the lazy adapter and contaminates the measured boot graph. Existing browser tests verify zero adapter requests before its first explicit read. Other generated changes follow main's rail, capability/settings splits, plugin asset preloading, and Solid presentation modules. Solid loading-skeleton dependencies remain chat-specific rather than entering the New Session group. Final capture: 2,076 shared modules, 89 New Session-only modules, 337 chat-only modules; 15/16 dynamic entries.
Validation
Head:
c1ee746907d7dd6a1afed6efb7b06d55ddb138d2. Containsdb6449d3f609,2bf00b83d309, and4ceb3918b445. Fresh detached reviews are clean, including the rail adaptation and regenerated manifest.Focused proof passed: snapshot lifecycle (21), snapshot admission (4), snapshot persistence (13), warm roster (31), session projection (36), row rendering (7), rail (19), Online workload (17), plugin runtime (16), bootstrap warm boot (6), route warm boot (11), chunking (5), readiness E2E (4), mobile/desktop PR presentation (12), sidebar cold load (1), dashboard cold load (1), and provider browser login (1). The cached-to-live plugin failure exposed a stale reference to main's removed plugin-navigation set; that path was deleted and the error-recovery E2E now passes. The dedicated Online view retains its empty list after the last user disconnects. The mobile PR test now waits for the same containment bounds after resizing; no bounds were relaxed.
The full canonical UI E2E suite completed on this exact head with
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --maxWorkers=2, with no include/exclude or real-Gateway skip flags. Wall time: 5,774.83 seconds (96m 15s). Result: 736 files passed, one failed, one skipped; 3,361 tests passed, one failed, one skipped.ui/src/pages/workboard/workboard-native-bundle.e2e.test.ts— Chromium returns focus to the card after closing details73f2255d77f0; inherited, outside the changed ownersui/src/e2e/desktop-resize.real-gateway.e2e.test.tsskipIf(!fixturePath)for the unconfigured external desktop carrierThe Workboard failure is the sole failed case in both final-head local proof and CI. The earlier full attempt was deliberately stopped when the independent Pages-scope regression was discovered; it is not counted as completed proof.
Testbox
tbx_01m4janzqyr0swhz0e3jbmpq9gencountered two workspace-sync failures before testing and was stopped. Proof uses the authorized local fallback, one focused file at a time, and the explicit load-bounded full-suite/generator exceptions. No real account or operator Gateway was used.Focused single-file wall times
Single-worker results from the repository runner (
pnpm test <file> --maxWorkers=1, invoked through its equivalentnode scripts/run-vitest.mjsentry); E2E uses the canonical UI configuration. Longer E2E files exercise browser navigation, persisted reload, or actual HTTPS Gateway/provider restart boundaries. CI UI job seconds are unavailable because fail-fast canceled those jobs.ui/src/app/app-host-refresh-control-ui.test.tsui/src/app/bootstrap.warm-boot.test.tsui/src/app/control-ui-chunking.test.tsui/src/app/control-ui-favicon.browser.test.tsui/src/app/gateway-store.device-credential.test.tsui/src/components/app-sidebar-session-projection.test.tsui/src/components/app-sidebar-session-row-render.test.tsui/src/components/session-data-controller.warm-boot.test.tsui/src/components/app-sidebar-online.test.tsui/src/components/sidebar-online-order.test.tsui/src/components/sidebar-snapshot-controller.test.tsui/src/components/sidebar-snapshot-model.test.tsui/src/e2e/chat-footer.e2e.test.tsui/src/e2e/chat-pull-requests.e2e.test.tsui/src/e2e/dashboard-cold-load.e2e.test.tsui/src/e2e/provider-browser-login.real-gateway.e2e.test.tsui/src/e2e/session-active-resources.e2e.test.tsui/src/e2e/sidebar-cold-load.e2e.test.tsui/src/e2e/warm-boot.e2e.test.tsui/src/lib/agents/roster-activity-store.test.tsui/src/lib/sessions/session-presentation.test.tsui/src/lib/sessions/session-roster-warm-boot.test.tsui/src/pages/chat/session-snapshot-store.test.tsui/src/pages/chat/sidebar-snapshot-store.test.tsui/src/plugins/control-ui-runtime.test.tsExact-head CI
Run 38101487182 is terminal; it was not rerun. Native Workboard's Chromium overlay-focus assertion (
workboard-native-bundle.e2e.test.ts:199) fails identically on clean current main73f2255d77f0(1 failed, 1 passed; WebKit passes). Its card does not regain focus after closing the dialog. This PR changes neither that test nor the Workboard focus owner.Overall: 40 jobs passed, 22 skipped, one canceled, and two failures (the originating E2E shard and the gate). The separately required full UI suite completed with the same sole inherited Workboard failure.
Production size
The requested production-stat command reports +892 net lines (+1,860/-968), including +50 generated manifest lines. Excluding the manifest: +842, down from the original +1,202. Growth beyond the previously approved cutover carries main's new rail-view/scope and dashboard/pin presentation contracts, the pre-render live handoff, and generator instrumentation control; there is still one persistence owner, one database, and one initial-read lifecycle.
Per-file production LOC
ui/config/control-ui-boot-modules.jsonui/scripts/control-ui-boot-manifest.mtsui/src/app/bootstrap-warm-boot.tsui/src/components/app-sidebar-base.tsui/src/components/app-sidebar-online.tsui/src/components/app-sidebar-personal-navigation.tsui/src/components/app-sidebar-rail.tsui/src/components/app-sidebar-render.tsui/src/components/app-sidebar-session-list-render.tsui/src/components/app-sidebar-session-navigation-logic.tsui/src/components/app-sidebar-session-navigation.tsui/src/components/app-sidebar-session-projection.tsui/src/components/app-sidebar-session-row-render.tsui/src/components/app-sidebar-session-types.tsui/src/components/app-sidebar.tsui/src/components/session-data-controller.tsui/src/components/session-row-subtitle.tsui/src/components/sidebar-agent-roster.tsui/src/components/sidebar-navigation-catalog.tsui/src/components/sidebar-online-order.tsui/src/components/sidebar-snapshot-capture.tsui/src/components/sidebar-snapshot-controller.tsui/src/components/sidebar-snapshot-data.tsui/src/components/sidebar-snapshot-model.tsui/src/lib/agents/roster-activity-store.tsui/src/lib/sessions/index.tsui/src/lib/sessions/session-boot-roster.tsui/src/lib/sessions/session-boot-snapshot.tsui/src/lib/sessions/session-capability.tsui/src/lib/sessions/session-roster-cache-database.tsui/src/lib/sessions/session-roster-cache-lifecycle.tsui/src/lib/sessions/session-roster-cache.reader.tsui/src/lib/sessions/session-roster-cache.runtime.tsui/src/lib/sessions/session-roster-cache.tsui/src/pages/chat/session-snapshot-database.tsui/src/pages/chat/session-snapshot-invalidation-events.tsui/src/pages/chat/session-snapshot-invalidation.tsui/src/pages/chat/session-snapshot-prewarm.tsui/src/pages/chat/session-snapshot-store.tsui/src/plugins/control-ui-capability.tsui/src/plugins/control-ui-runtime.tsui/src/styles/layout.cssui/src/test-helpers/app-sidebar.tsui/src/test-helpers/control-ui-e2e-readiness.tsui/src/test-helpers/control-ui-mock-presence.tsNo merge requested or attempted.