Repository navigation
perf(control-ui): restore the cached sidebar sooner on warm reloads - #189791
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: needs maintainer review before merge. What this changesThis PR preserves cached sidebar rows during reload handoffs and avoids mounting ordinary rows in wholly offscreen categories. Example: An expanded child-session query takes 4 seconds during a warm reload.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this maintainer-authored PR open: it makes a useful, focused improvement that current main lacks, with no concrete introduced correctness finding. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Control UI sidebar combines an admitted browser snapshot with Gateway session queries; its existing lifecycle and windowing owners determine when cached rows yield and which rows mount. flowchart LR
A[Browser snapshot] --> B[Sidebar snapshot owner]
C[Gateway roster queries] --> D[Readiness receipts]
D --> B
B --> E[Sidebar presentation]
E --> F[Session window]
F --> G[Visible and retained rows]
Technical reviewBest possible solution: Retain this focused repair in the existing sidebar owners and complete its draft validation before landing. Do we have a high-confidence way to reproduce the issue? Current-main source shows the timed incomplete handoff, immediate owner detach during host moves, and two-row admission for below-viewport categories; supplied browser measurements support the report, but this review ran no reproduction. Is this the best way to solve the issue? The patch repairs the existing lifecycle, handoff, and windowing owners without adding another cache or renderer, while extending the existing fixture to exercise grouped nondefault-agent sidebars. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 828b81ad1f94. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +6, Tests +71, Docs +6, Other +206. Total +289 across 15 files. Added test files: 0. View PR surface stats
LabelsLabel 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 31, 2026, 6:03 PM ET / 22:03 UTC. |
77b0304 to
ce6274f
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. |
ce6274f to
75e2d01
Compare
75e2d01 to
0728461
Compare
Keep the scoped cached sidebar until live roster and expanded-child reads settle, removing the three-second partial-display escape path. Retain the sidebar owner when native layout reparents its host in the same turn. Skip ordinary rows in wholly offscreen categories while preserving height and current selection/focus retention during queued geometry updates. Extend real-Gateway warm reload proof with grouped, involving-me settings, personal pins, retained children and archived nondefault-agent deep links.
0728461 to
fd439a4
Compare
…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
Warm reloads can discard already displayed cached sidebar rows during native host reparenting or while an expanded-child roster is still loading. A newly selected offscreen row can also be remounted when scrolling precedes scheduled geometry. The campaign's dashboard-deep-link reload evidence recorded 14 visual states; this supporting change targets the sidebar restoration work within that flow.
Why This Change Was Made
Keep the sidebar owner attached across same-turn host reparenting, matching the bridge view's existing lifetime. Transient menus and person cards still dismiss immediately at native detach. Remove the three-second forced partial handoff so the cached sidebar remains until the root and expanded-child reads settle. Preserve the DOM identity of a newly selected offscreen row while its scheduled geometry update is pending. The offscreen-row suppression and its scrolling-test adaptation are now upstream in #189821; their superseded L259 changes were removed.
The settings-correct Team-shape fixture and probes remain reusable by both the ordinary and transcript/short-visit warm-reload modes: involving-me/category/created, 97 groups, five collapsed sections, empty-groups policy, previews off, pins, archived dashboard-qualified chat targets and expanded children. The existing reconnect and delayed-child regression cases are retained.
Source attribution: immediate sidebar owner retirement was wired in
e80558a4da0f(#168852); the three-second completeness bypass was introduced inc44496a0cb48(#180569). Both precede r24183c57bf3. No post-r241 introducing commit was established for the reported initial chat blank. This PR carries the independently reproduced supporting fixes; it does not claim a completed binary bisect or restoration of the entire first-app page.User Impact
Cached rows remain displayed through same-turn reparenting and slow roster handoff; newly selected rows remain mounted while geometry catches up. No configuration, Gateway protocol or server schema changes.
This does not fix the chat-route initial blank or the deletion invalidation storm. The storm is handled separately in #189729. The initial chat owner/model and scheduled-geometry gap is assigned to a follow-up that builds on this branch. The initial chat gap remains observable. The deletion-storm fix is already in the rebased main and is not part of this diff.
Evidence
Final-head focused/native tests, both pre-fix red controls, runtime/UI builds, combined transcript/short-visit rig smoke and
check-changed.mjspass onfd439a456597ac9154be5889a192718e0216537d, based on mainc2bbb1059f85c3fe542e1f6620dea0e6bd4f18b2. Fresh complete-candidate review is clean through P2. The full UI suite completed: 884 files passed, two failed, and three skipped; both failures reproduce unchanged on pristine main. Exact-head CI is green. The three sidebar runtime blobs are unchanged from the previously tested head. The merged rig shares one 97-category shape across both proof modes.Historical combined comparison
The measurements below cover the earlier combined L259 prototype, including offscreen-row suppression now landed in #189821. They are retained for campaign provenance and the requested per-pair counts; they are not an isolated speedup claim for the remaining rebased diff. The historical 97-category probe reduced mounted sidebar rows from 154 to 19; that range suppression is now upstream.
Accepted supporting measurements: 11 interleaved pairs per route on one quiet AWS
c7a.4xlarge(cbx_962e59f9fa51), repository Chromium, synthetic Team-scale data, real loopback Gateway, 80 ms network profile, unprofiled. Measurement candidate1674aedfc2de, base84133d32283a; the original combined candidate also precedes the immediate transient-menu/person-card dismissal repair at native detach. The remaining rebased diff is validated separately below. All 556 captured PNGs across 44 warm runs were inspected. The ordinary rig pauses peer JavaScript, so it does not prove storm behavior. Timings are not from the shared Mac.The tiny chat CLS increase has non-overlapping IQRs (0.003919 → 0.003967); raw deltas are included below. Other mixed/overlapping secondaries are reported without claiming improvement. The original complete-first-app chat gate did not pass; this PR is the separately approved supporting win.
Final-head validation
Head
fd439a456597ac9154be5889a192718e0216537d, pristine main controlc2bbb1059f85c3fe542e1f6620dea0e6bd4f18b2, AWSc7a.4xlargeleasecbx_5b32e482ac20(run). Frozen-lockfile install and repository Chromium/WebKit setup pass. Times are whole command wall times, not performance measurements.pnpm test ui/src/components/app-sidebar-online.test.ts --maxWorkers=1(Node)pnpm test ui/src/components/sidebar-snapshot.test.ts --maxWorkers=1pnpm test test/scripts/team-shape-fixture.test.ts --maxWorkers=1pnpm test ui/src/components/app-sidebar-session-visibility.browser.test.ts --maxWorkers=1pnpm test ui/src/e2e/sidebar-complete-roster.e2e.test.ts --maxWorkers=1pnpm test ui/src/e2e/session-management.sidebar.e2e.test.ts --maxWorkers=1pnpm check:test-lines-ratchet --base c2bbb1059f85c3fe542e1f6620dea0e6bd4f18b2pnpm build:runtimepnpm ui:buildnode scripts/check-changed.mjsnode scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.tsfd439a456597ac9154be5889a192718e0216537dBoth new-main red controls fail at the intended assertions: selected-row DOM identity (
.toBe(selected)) and the delayed-root three-second handoff (liveversuscached). Both pass in the unchanged candidate suite. Reconnect/forced-handoff regression coverage is retained. Transient surfaces still dismiss synchronously at native detach; the unchanged person-card tests pass under Node and pinned Bun.All export scans now pass on this base; the previous base's unused-export finding is gone. Lint reports one existing Solid reactivity warning in the window scheduler and no errors. No suppression or baseline exception was added. Validation uses the committed candidate unchanged; no skip flag, readiness condition or timeout was altered to obtain a passing rerun. Both rig modes passed on both routes. All four cache receipts report
state=live,saved=true, one persisted sidebar snapshot and one target transcript snapshot; sidebar record byte sizes are positive. The 97-group/102-section-order shape, five collapsed sections and archived targets were asserted. These functional smokes are not a new performance comparison.The full UI command exited 1. Fresh single-file candidate/main controls reproduce both failures with the same errors; neither was waived or fixed by this PR:
extensions/qa-lab/src/control-ui-automation-management.real-gateway.e2e.test.tsui/src/e2e/chat-outbox-migration.e2e.test.tsAll other 884 full-suite files pass, including the native sidebar and active-panel dashboard tests. The three skipped files are the desktop-resize, deferred-steer-custody and DeepSeek-search fixtures. The complete 889-file pass/fail/skip manifest and logs are retained with the lane proof. The final source head and clean tracked tree were verified after validation. All lane leases are released; no local Gateway was started.
Scope and size
UI runtime: three files, net +4 LOC. Requested production filter including perf fixture/probe/runbook: +260/−103, net +157. The timeout/expired path is deleted; no second cache owner is added. Runtime growth preserves the separate contracts for immediate transient dismissal, retained data ownership during same-turn moves, and selected/focused rows in windowed lists. Most growth is the reusable settings-correct fixture and evidence probes. No changelog change; release-note context: grouped cached sidebars restore sooner and survive same-turn reparenting and slow child-roster handoff.
Historical combined synthetic before/after
These captures show the earlier combined candidate, including the window suppression now upstream. They document the historical timing result. Final-head matched handoff captures follow below.
Representative paired chat reload, original full-page headless captures with synthetic data only. These are different capture times, explicitly labeled: main is still empty at ~891 ms; the candidate has populated sidebar rows by ~806 ms. Both had an earlier empty first-app frame. This shows earlier fill, not a claim that the initial blank or later style/avatar settling is fixed.
Main, ~891 ms after navigation:
Candidate, ~806 ms after navigation:
Final-head matched handoff captures
These full-page synthetic captures use the same held roster read on the dashboard route. Main has already handed off to live at the three-second boundary; the candidate retains the cached roster with actions disabled until the read settles. The visible rows look similar in this fixture, so these pictures do not claim a visible row-count reduction. The regression assertions prove the retained row keys and DOM identity. The unrelated synthetic sandbox widget is unavailable in both arms.
Main, held-read handoff:
Candidate, retained cached roster during the same held read:
All medians, IQRs and per-pair deltas
11 interleaved pairs per route on one fixed c7a.4xlarge. Pair warm-01 with warm-01, through warm-11; capture alternates AB/BA order. Candidate minus baseline; negative is lower. Quartiles use linear interpolation at (n−1)q. Values are the L248 report probe fields plus manual first populated sidebar/child-pixel timestamps.
The firstPaintedRowsMs field is transcript text Element Timing, not sidebar rows. finalRowsDomMs is the last observed transcript row-signature change, not final paint. LoAF and CLS cover the whole capture; costs are not attributed exclusively to sidebar. Faster fill does not pass the absolute first-app sidebar gate: candidate chat still has a gap in 11/11 runs.
Campaign secondary rule: adverse non-overlapping IQRs, or ≥9/11 worse pairs with median paired rise >max(10ms,3% baseline median). CLS has no invented millisecond paired threshold; its IQR and raw per-pair values are reported. Favorable timing evidence never replaces correctness, cache provenance, storm coverage, or the absolute ≥10/11 complete-first-sidebar requirement.