Repository navigation
fix(control-ui): keep sidebar rows steady through reload - #180569
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. |
69d400d to
fb78681
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR retains cached sidebar rows until the live roster and visible child queries settle, with a three-second fallback deadline. Example: Reload a signed-in chat or dashboard with 24 visible sidebar rows, including four expanded children.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open. This maintainer-authored PR fixes a demonstrated sidebar handoff defect that remains on main; inspection found no actionable introduced bug, and the exact-head CI gate now passes. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Control UI sidebar consumes scoped session-query results and an IndexedDB display snapshot, then hands rendering from cached rows to authoritative live rows. flowchart LR
A[IndexedDB sidebar snapshot] --> B[Scoped snapshot owner]
C[Gateway session queries] --> D[Session capability]
D --> E[Roster and child readiness]
E --> B
F[Foreground readiness and deadline] --> B
B --> G[Stable sidebar rows]
Technical reviewBest possible solution: Keep one scoped snapshot owner and release its cached projection once live membership settles or the bounded deadline expires. Do we have a high-confidence way to reproduce the issue? Source confirms that the previous readiness condition could release cached rows before child membership completed, matching the supplied baseline filmstrips and 24 → 20 → 24 row timelines; no target code was executed during this review. Is this the best way to solve the issue? The patch is a focused repair: it consumes existing canonical and child-query receipts, retains the established foreground/idle handoff, and replaces its deadline without adding a competing roster or merge path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 082e55e28d33. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +42, Tests +526, Other +20. Total +588 across 18 files. Added test files: 1. View PR surface stats
Review metrics
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 Reviewed October 22, 2026, 1:54 PM ET / 17:54 UTC. |
…0569) Peter reported a late sidebar flicker on Team reloads. The live r183 filmstrip showed one shrink-then-grow at the cached-to-live handoff: the snapshot owner released cached rows as soon as the root sessions list answered, while visible child-session queries (expanded rows) were still loading, so the sidebar briefly dropped from 24 to 20 rows and grew back. The handoff now waits until the live roster is complete for the current scope: the canonical sessions.list has published (not a reconnect revision), and every visible child parent has loaded or errored. The cached rows stay exactly as they are until then, with a 3 s cap from connect (at the cap, whatever has arrived is shown). Snapshot rows now record childLoadParentKeys so the restored tree knows which parents' children it shows; old cache records without it, or any record that fails validation, are deleted and rebuilt instead of failing the whole read (disposable cache, no migration). Evidence (AWS c7a.4xlarge, staggered-query Team-scale fixture, 11 interleaved pairs per route on the rebased head): chat and dashboard both 2 -> 1 transitions, 0 shrink-grow, 0 blank frames, all 24 row nodes retained; chat LoAF -6 ms, hello -15 ms, settled -3.9 ms, FCP 0 ms (paired). Accepted tradeoff (maintainer): dashboard-reload LoAF +24 ms paired median (IQR -9..+45) vs an A/A noise band of -27 (IQR -47..+21). Runtime +42 LOC. Touched-area e2e 9 files / 25 tests passed; changed checks 27 passed, 3 failures inherited from main; exact-head CI green.
…184334) Peter asked to store more data offline so warm reloads don't visibly load. Cached transcript rows painted first and then grew as reactions, failure notices, activity groups and run-frame content arrived after the transcript became ready. Reaction summaries were not in the transcript snapshot, and run frames published their retained child ranges only after the frame shell settled. The disposable, bounded transcript snapshot now also persists reaction summaries (server facts only, same session incarnation) and the context-window size. Cached rows render reactions, failure notices, activity groups, metadata and run-frame child ranges in the row's first commit. Live reads reconcile in place, and run-frame widget custody is unchanged. Evidence, 11 interleaved AWS pairs per route: chat later structural frames 3 -> 1, cached-row growth 58 -> 0 px, complete rows 1,026 -> 815 ms; dashboard frames 7 -> 5, growth 96 -> 64 px. 20 focused files and 11 native UI e2e files pass; full UI suite 841 passed, 1 unrelated QA-lab fixture failure. Accepted tradeoff: first painted rows +28 ms chat / +16 ms dashboard, snapshot +9.4 KB, dashboard CLS +0.004 (precedent #180569). One new untrack allowance for the run-frame initial sample, approved by the maintainer (2026-10-25). The shrink-only controller ratchet has no approval input, so it is the only failing check. Runtime +119 LOC (handwritten).
…penclaw#184334) Peter asked to store more data offline so warm reloads don't visibly load. Cached transcript rows painted first and then grew as reactions, failure notices, activity groups and run-frame content arrived after the transcript became ready. Reaction summaries were not in the transcript snapshot, and run frames published their retained child ranges only after the frame shell settled. The disposable, bounded transcript snapshot now also persists reaction summaries (server facts only, same session incarnation) and the context-window size. Cached rows render reactions, failure notices, activity groups, metadata and run-frame child ranges in the row's first commit. Live reads reconcile in place, and run-frame widget custody is unchanged. Evidence, 11 interleaved AWS pairs per route: chat later structural frames 3 -> 1, cached-row growth 58 -> 0 px, complete rows 1,026 -> 815 ms; dashboard frames 7 -> 5, growth 96 -> 64 px. 20 focused files and 11 native UI e2e files pass; full UI suite 841 passed, 1 unrelated QA-lab fixture failure. Accepted tradeoff: first painted rows +28 ms chat / +16 ms dashboard, snapshot +9.4 KB, dashboard CLS +0.004 (precedent openclaw#180569). One new untrack allowance for the run-frame initial sample, approved by the maintainer (2026-10-25). The shrink-only controller ratchet has no approval input, so it is the only failing check. Runtime +119 LOC (handwritten).
…189791) Warm reloads keep the cached sidebar until the live roster has actually finished or failed. The three-second partial-display escape from #180569 is deleted: it replaced already painted cached rows with an incomplete live sidebar during slow child-roster reads. The existing readiness owner still settles on completed or errored root, child and count reads, so the handoff always completes. The sidebar owner now detaches only when its host is really gone (same-turn native reparenting keeps the retained view, while transient menus still dismiss synchronously), and the session window keeps focused and selected rows even when scroll precedes the geometry retention update. Proof: AWS real-Gateway warm reloads (11 pairs per route, combined with the now-upstream offscreen-row change from #189821): sidebar fill 942.54 to 783.61 ms on chat and 814.48 to 665.78 ms on dashboard, both 10/11 better. Runtime net +4 LOC; the rest is the reusable warm-reload fixture and probes. Exact-head CI green; full UI 884 pass / 2 fail, both failures reproduce on pristine main.
…penclaw#189791) Warm reloads keep the cached sidebar until the live roster has actually finished or failed. The three-second partial-display escape from openclaw#180569 is deleted: it replaced already painted cached rows with an incomplete live sidebar during slow child-roster reads. The existing readiness owner still settles on completed or errored root, child and count reads, so the handoff always completes. The sidebar owner now detaches only when its host is really gone (same-turn native reparenting keeps the retained view, while transient menus still dismiss synchronously), and the session window keeps focused and selected rows even when scroll precedes the geometry retention update. Proof: AWS real-Gateway warm reloads (11 pairs per route, combined with the now-upstream offscreen-row change from openclaw#189821): sidebar fill 942.54 to 783.61 ms on chat and 814.48 to 665.78 ms on dashboard, both 10/11 better. Runtime net +4 LOC; the rest is the reusable warm-reload fixture and probes. Exact-head CI green; full UI 884 pass / 2 fail, both failures reproduce on pristine main.
What Problem This Solves
Fixes the late sidebar flicker Peter reported when reloading a signed-in chat or dashboard deep link. The r183 filmstrip showed one shrink-then-grow at the cached-to-live handoff: a partial live roster was published before the remaining boot queries answered. The two changes were about 80 ms apart; the earlier blank-sidebar issue was already fixed.
User Impact
Cached sidebar rows stay in place until the complete live roster is available. The handoff happens once, retaining the existing rows. On exceptionally slow loads, the three-second cap publishes the available live data and can permit a later change.
Why This Change Was Made
Keep the existing foreground/idle handoff and check the current scope's canonical roster, selected roster/owner queries, counts, and visible children before releasing the cache. Reconnect resets the deadline; account/owner changes still replace the scope. There is no partial-merge path. The disposable sidebar cache records the child-query keys and retires incompatible entries individually.
This is the original minimal gate, rebased without product edits. Runtime delta: +42 lines (63 added, 21 removed across seven owners). The requested broad diff-stat filter reports +98 (157 added, 59 removed across 12 files), including benchmark/fixture/test-support changes. The added runtime state is required to carry roster completeness and the bounded deadline; it replaces the old handoff timer rather than adding another handoff mechanism.
Accepted tradeoff
Peter explicitly accepted the dashboard reload cost on 2026-10-22. The prior 15-pair comparison measured dashboard-reload LoAF +24 ms paired median, IQR −9..+45, against an A/A paired noise distribution of −27 ms median, IQR −47..+21. Those results originally parked this gate; the maintainer has now accepted the cost to remove the reported flicker.
Those accepted figures are from head
69d400db791don AWSc7a.4xlarge, leasecbx_c4722fd82a33, run. They remain distinct from the fresh rebased-head results below.Evidence
Rebased head
fb78681a808cff03c92e708056b9e47cab106081, mainb2094b686c5e44378c57240a6503a6504de30885. AWSc7a.4xlarge, leasecbx_65236dd3868a, run. Eleven interleaved baseline/candidate pairs per route on the same instance, repository headless Chromium, production bundles, synthetic Team-scale fixture, fixed synthetic time, identical probes. Timing samples are untraced; the filmstrips are separate traced runs. The HTTP/WS boundary is the benchmark's synthetic Gateway fixture, not a live Team account.Live-like query delays: ownerFirst 400 ms, involvingMe 500 ms, ownerCounts 425 ms, children 700 ms; connect starts no earlier than 450 ms with a 250 ms response delay. Fixture: 390 sessions, 34 owners, 120 people, 240 transcript messages, 12 inline widgets, persistent expanded child rows, and a synthetic dashboard MCP app.
All baseline row timelines are 24 → 20 → 24; every candidate stays at 24. Chat LoAF, hello, FCP, and transcript settlement pass the no-regression rule. New dashboard measurements also have overlapping IQRs and mixed pair signs; the accepted historical cost above is retained explicitly.
Chat timing
Milliseconds, median [IQR].
Dashboard timing
Milliseconds, median [IQR].
Per-pair deltas (candidate minus baseline), milliseconds
Chat
Dashboard
Synthetic visual proof
Traced frames; their timestamps include recording overhead and are not timing results.
Validation
The unchanged head has clean independent review through P2; the existing review is reused because no product code changed. Both production builds, all 44 untraced reloads, the 11 focused unit files, and the original scoped e2e run passed. Exact-head CI run 39824507080 succeeded on
fb78681a808cff03c92e708056b9e47cab106081.The recovery run used AWS
c7a.4xlarge, leasecbx_10637a2fc24c, run. All nine touched-area UI e2e files passed: 25 tests, 0 failures, 181.28 s command wall time (178.34 s Vitest duration), with--maxWorkers=1. Coverage includes incomplete/capped rosters, new/rename/status/delete updates during loading, owner/account replacement, cached-list stability, dashboard first paint, and warm boot.Files:
sidebar-complete-roster,sidebar-cold-load,sidebar-cached-list-stability,session-owner-warm-refresh,sidebar-users-filter,dashboard-cold-load,sidebar-profileless-scope,sidebar-account-footer, andwarm-boot(ui/src/e2e/*.e2e.test.ts). Command:node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts <the nine files above> --maxWorkers=1.node scripts/check-changed.mjs --base b2094b686c5e44378c57240a6503a6504de30885completed with 27 checks passed, 3 failed (799.23 s). All core/UI/script type checks, changed-file lint, formatting, and UI controller checks passed. The three failures are inherited and were compared separately against mainfb824384939f40592ab6d79f4c43a8a873e2106don the same lease:chat-message.test.tsxsuppression fails on both. The branch also reportsconfig-page-state.tsandsessions-page-state.ts; those files and the baseline are byte-unchanged from the PR base, and current main no longer reports them.MAX_PLUGIN_COMMAND_SCHEDULE_BYTES,ScheduledOccurrenceRun, and approval-presentation exports. Reports differ as main has evolved; none of the reported paths is changed by this PR.The earlier full UI run was interrupted when its lease ended, so it is not claimed as complete. Its copied log records 3,381 passing test entries and one failure in
control-ui-stale-build-reload.e2e.test.ts: “Production build did not emit the Activity lazy chunk.” The same test fails with the same error on current main (1 test, 1 failure; 99.30 s command wall time). The test expectsactivity-page-*, while the build emitsactivity-route-*. The fresh nine-file run above covers all touched areas.No product changes were made beyond the earlier conflict-free rebase. This PR remains ready for maintainer review and is not merged.