Repository navigation
perf(control-ui): admit the cached chat pane with its first mount on warm reloads - #189760
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 starts cached transcript preparation earlier and lets the first matching chat pane wait up to 100 ms before mounting. Example: Warm reload of an archived conversation with a cached parent breadcrumb.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored draft addresses a concrete warm-reload layout defect, and review found no discrete introduced correctness or security bug. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherControl UI startup reads an account-scoped browser snapshot while loading application modules; the existing pane hydration owner adopts validated display facts and later reconciles live Gateway state. flowchart TD
A[Browser reload] --> B[Startup and early Gateway]
B --> C[Scoped snapshot preparation]
B --> D[Application module loading]
C --> E[Bounded first pane admission]
D --> E
E --> F[Existing snapshot hydration]
F --> G[Cached pane and live reconciliation]
Technical reviewBest possible solution: Retain the existing scoped snapshot and hydration owners while overlapping preparation and bounding the first matching pane's wait. Do we have a high-confidence way to reproduce the issue? Current-main source permits first mount before asynchronous snapshot preparation completes, matching the submitted before measurements; no target code was executed during this read-only review. Is this the best way to solve the issue? The patch is a focused solution: move existing preparation earlier, share its completion receipt, and join at the existing mount boundary without adding another cache or adoption path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 01ac91c280f7. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +50, Tests +77, Docs +23, Other +245. Total +395 across 13 files. Added test files: 0. View PR surface stats
Review metrics
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, 5:12 PM ET / 21:12 UTC. |
18c9020 to
e2ae1d9
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. |
e2ae1d9 to
0ba42f2
Compare
0ba42f2 to
4378f48
Compare
4378f48 to
fe33882
Compare
Start the existing scoped snapshot read and validation alongside application module loading, after early Gateway startup. Bound a remaining first-pane wait at100ms so transcript, parent breadcrumb and archived composer facts are admitted before attach. Preserve boot paint holding and live request authority.
fe33882 to
fd10489
Compare
…warm reloads (openclaw#189760) Warm reloads now start the scoped chat snapshot read and validation before the application graph loads, and the first matching chat pane waits at most 100 ms for that prepared snapshot before mounting. The breadcrumb and archived footer arrive with the first header instead of inserting 144 px of identity and contracting the composer by 26 px afterwards. Boot-record credential admission now has one owner (readCredentialBootRecord); the duplicate bootstrap policy and the late-only prewarm path are removed. The startup JS baseline records the measured earlier-load redistribution (89,354 to 90,111 B gzip) while complete Chat and New boot shrink by 279 and 200 B. Proof: 11 interleaved AWS warm chat pairs moved first rows from 464 to 364 ms (paired median -96 ms, 11/11 better), with FCP, hello and LoAF within A/A. The exact-head checks-ui-e2e sidebar geometry failures reproduce on the PR base and pass once current main is merged (local control of both files).
What Problem This Solves
A signed-in warm reload can mount its chat pane before a valid cached snapshot is ready. The cached parent breadcrumb and archived footer then arrive after the first header sample, inserting 144.219 px of identity content and replacing the generic composer with a shorter archived footer.
Why This Change Was Made
Start the existing scoped snapshot read and validation immediately after early Gateway startup, in parallel with application-module loading. The pane's existing first-mount boundary joins only the matching boot prewarm, for at most 100 ms. An already prepared snapshot is adopted synchronously before the pane attaches. Connect stays first; no pre-hello requests are added.
The late-only prewarm path and duplicate boot-record read policy are removed. The early chat prewarm is separated from sidebar-only code; shared preparation and the bounded admission wait remain in the snapshot store that consumes them. There is one snapshot owner, with unchanged serialized shape. The integration preserves the landed sidebar deletion/invalidation behavior and per-record malformed-cache retirement. Runtime growth is 65 lines across eleven UI modules, justified by the bounded first-mount join and idempotent early preparation. No new store, inline-script data path, config option, server schema or protocol change.
User Impact
Matching warm reloads admit the cached breadcrumb and archived footer with the first pane mount, avoiding their later insertion/contraction. The chat benchmark also paints first transcript rows earlier.
This is a partial admission improvement. It does not fix the complete-page first-paint gate, boot skeleton/paint holding, remaining reconnect/session-menu movement, board/row/image geometry, or sidebar invalidation. Short or ambiguous routes whose target differs from the saved last-session key retain the existing asynchronous fallback; this PR does not fix that case. The first-header observations below are DOM/rAF samples, not proof of a complete compositor frame. Dashboard Element Timing receipts were unavailable; no dashboard row-paint improvement is claimed.
Evidence
Quiet AWS
c7a.4xlarge, leasecbx_5dc3b6e9b9ee(released), observed 16 CPUs/30 GiB RAM. Repository Chromium, Team-scale fixture, archived session with parent breadcrumb, live-fast profile, unprofiled. 11 interleaved pairs plus 11 A/A pairs on each route. Measurements used runtime source7d0b79237d65acb8c32f64e80f89492194501da0against31b6b8a1817c6f09c6854d92b3c3b55d17f3189f; later source revisions preserve the same admission contract while separating early chat preparation from sidebar code and locating pane-only admission in the snapshot store. The current chat confirmation below was rerun after integrating the landed snapshot invalidation fix. The same pane-chrome probe ran in both arms; the candidate bundle used its regenerated boot manifest.Latest runtime confirmation after upstream integration
Current and measured head
fd1048953c301a99c1f3907af8cb20c6a49ff919, exact base177fe32dfdd77152780442a4c13a806d26d088fc. Quiet AWSc7a.4xlarge, leasecbx_ddaa82569481(released), observed 16 CPUs/30 GiB. Run receipt. Eleven alternating A/B pairs plus eleven A/A pairs on chat, the same archived long-Markdown Team-scale fixture, operator sidebar shape and live-fast profile, unprofiled. No tests or transfers ran during captures. All thirteen source/metadata hashes match the committed head; both manifests were regenerated by the owner CLI, the candidate manifest matches the committed file, and the working tree is clean. This is the requested one-route confirmation after the snapshot owner changed upstream; no new dashboard timing result is inferred.Breadcrumb and archived footer: 0/11→11/11 each. Identity insertion 144.219→0 px, footer contraction 26→0 px, all eleven. First-header facts plus zero subsequent snapshot-region movement pass 11/11. First-header timing, FCP, hello and LoAF have no declared regression signal against A/A. The four-byte snapshot difference is fixture serialization variation; record fields and serialization/write logic are unchanged, so it is not a structural saving. All 44/44 captures have one connect, zero non-connect RPCs before its raw response, and no missing paint receipts, truncated probes, harness warnings or queued/pending RPCs. Independent raw-data and source-hash audit confirms these results. The independent 32 px session-menu step remains.
Starting the scoped read and validation earlier redistributes bytes into the initial graph. The original startup gate failed at 90,111 B against 89,930 B; that failure is retained, not labeled passing. After extracting sidebar-only code and keeping pane-only admission with the consuming store, the exact 90,111 B measurement was recorded as a narrow, source-verified exception under the repository testing policy. The 512 B growth allowance, 64 B build-variance allowance and fixed maximum remain unchanged. The rebased candidate passes the strict gate at 90,189 B, 78 B above the recorded measurement and below the unchanged 90,687 B enforcement limit; this 78 B is not described as build variance. No baseline allowance or test-line ceiling is raised by this integration.
Accepted original both-route comparison
The following retained results qualify both routes before the later startup-byte repairs; the latest runtime confirmation above covers chat, as requested. No complete-page first-paint pass is inferred from either dataset.
Chat first-row paired median is −100 ms, 11/11 better. FCP paired median is 0 ms on both routes. Hello and LoAF have no regression signal beyond the A/A controls. Across the independent benchmark and real-Gateway captures, all 176 warm reloads used one connect and zero non-connect requests before its response.
The independent synthetic real-Gateway filmstrips still show incomplete replacement surfaces and later layout/content changes, so no stable complete-page first-paint pass is claimed. Real-Gateway timings use a different shaping profile and are not pooled with the native benchmark. The partial admission gate is the scope of this PR; the complete-page gate remains follow-up work.
Validation
The exact current head passes all ten affected owner-unit files and all six native bridge cases on the quiet comparison box,
cbx_ddaa82569481. The parameterized bridge regression protects ready-before-mount and bounded release on a stalled read, and fails on the old runtime at the intended premature-header assertion. No test-only production seam is introduced.All changed test files pass through
pnpm test <file> --maxWorkers=1(via Corepack on AWS). These are command wall times, not performance comparisons.ui/src/app/bootstrap.snapshot-prewarm.test.tsui/src/pages/chat/chat-history-warm-startup.test.tsui/src/pages/chat/chat-pane-bridge.test.tsxui/src/pages/chat/route-snapshot.test.tsui/src/pages/chat/session-snapshot-prewarm.test.tsui/src/pages/chat/session-snapshot-store.test.tsApplication-source autoreview is clean through P2, including integration with the landed invalidation fix. The earlier module extraction, shared credential policy, store-owned bounded wait, generated manifest and metadata follow-up were also reviewed clean. The hosted review completed on exact head
fd1048953c301a99c1f3907af8cb20c6a49ff919with no findings; there are no inline findings.On the exact current head, all six benchmark/probe harness files and all five touched-area native UI e2e files pass: browser bootstrap (24 s), bootstrap UI preferences (23 s), pane snapshot state (27 s), snapshot routing (41 s), and header owner presence (27 s). The strict bundle-byte gate, generated-manifest comparison, UI/Gateway builds, core/UI/script type checks, formatting, lint and the other changed-file ratchets pass. Validation used AWS
c7a.8xlarge, leasecbx_01d5241843b1(released), observed 32 CPUs/61 GiB. The larger validation runner is justified by the earlier kernel-confirmed 30 GiB combined-lint memory kill; performance comparisons remain onc7a.4xlarge.node scripts/check-changed.mjs --base origin/mainexits 1 (1,220 s command wall time), solely on the global unused-export scan:scripts/lib/release-publication-watch.mts: observePublication. The production-source scan has zero unused exports. A main control at26546c07a7205393f5e307521c241a3efb088e26reproduces the same release-tooling export failure. This is recorded as an inherited failure, not a green changed-file gate.The full current-head UI result is 881 passed / 5 failed / 3 skipped files, 3,349 passed / 8 failed / 4 skipped cases; the complete file list is below. All failures have matching-signature main controls:
mobile-sidebar-session-menu.e2e.test.ts(2 cases)177fe32dfdd77152780442a4c13a806d26d088fcsession-management.trailing-state.e2e.test.ts(3 cases)177fe32dfdd77152780442a4c13a806d26d088fcprofile-page.real-gateway.e2e.test.ts(1 case)177fe32dfdd77152780442a4c13a806d26d088fcchat-outbox-migration.e2e.test.ts(1 case)26546c07a7205393f5e307521c241a3efb088e2626546c07a7205393f5e307521c241a3efb088e26The first three controls ran one file at a time on the exact branch-base main revision, not a claim about the latest moving main: AWS
c7a.4xlarge, leasecbx_f45ec3bebe9d(released), observed 16 CPUs/30 GiB, control run. Gateway build passes; command wall times are 38 s / 25 s / 226 s. All three test-source hashes are identical on pinned main, the candidate full run and the current worktree. Post-control head is unchanged, source status is clean, and no test Gateway listener remains. The other controls used AWSc7a.4xlarge, leasecbx_add2eeef9964(released), main-control run. No security guard, readiness assertion or geometry expectation was weakened.Exact-head CI is red, with inherited failures classified above. Run 41266715301 completed on
fd1048953c301a99c1f3907af8cb20c6a49ff919: 41 successful jobs, 2 failed jobs, 24 skipped. The only failing test job is checks-ui-e2e (1/7), job 124731230790: the same five sidebar geometry cases in the first two rows. The second failed job is the dependentopenclaw/ci-gate, not another test failure. Its failed-job log was fetched once and compared with the main control. No CI rerun, branch update or unrelated source change was made to chase green. All jobs are terminal; no passing-CI claim is made.Change and test budget
Application runtime: +65 lines (251 additions / 186 deletions), bridge regression: +77, benchmark/probe/runbook tooling: +276, generated boot-module data: +8. The startup baseline update has zero net lines. The exact requested campaign diff filter reports 714 additions / 288 deletions (+426), 20 files, because it retains tooling and
.test.tsx; application runtime is counted separately. Growth is required by the bounded matching first-mount join and early authorized preparation; the late-only path and duplicate boot-record policy are deleted. The parameterized native bridge cases share setup; no test-line ceiling or allocation is changed. The current-head test-line gate passes at 6,365,276 lines against the unchanged 6,384,217 ceiling (18,941 lines of headroom).Synthetic screenshots
These inspected before/after screenshots from the preceding measured revision show the settled synthetic viewport; the later repairs change preparation ownership, with the same pane DOM/CSS. They establish the retained final appearance, not the transient first-header timing; the sampled admission and movement results are in the tables above.
Original both-route comparison: all A/A and A/B distributions and per-pair deltas
Timing columns are milliseconds; CLS is unitless and snapshot deltas are bytes. Source: retained raw benchmark JSON. First-header observations are DOM/rAF samples.
comparison · chat
comparison · dashboard
aa · chat
aa · dashboard
Current rebased chat confirmation: all A/A and A/B distributions and per-pair deltas
First-pane admission analysis
comparison: chat
Source: retained per-run benchmark JSON.
11 interleaved pairs: true; complete recorded probe data: true; identical bundle arguments: false.
Individual pane facts, rectangle deltas, all observed changes and attribution-compatible steps are retained in admission-analysis.json.
aa: chat
Source: retained per-run benchmark JSON.
11 interleaved pairs: true; complete recorded probe data: true; identical bundle arguments: true.
Individual pane facts, rectangle deltas, all observed changes and attribution-compatible steps are retained in admission-analysis.json.
Full UI e2e on the current head
The full suite ran on exact head
fd1048953c301a99c1f3907af8cb20c6a49ff919: 881 passed / 5 failed / 3 skipped files; 3,349 passed / 8 failed / 4 skipped cases. This is a failed full run, not a green-suite claim. AWSc7a.8xlarge, leasecbx_01d5241843b1(released), observed 32 CPUs/61 GiB; run receipt. Command:node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --maxWorkers=4, with real-Gateway and production-artifact skip flags and include overrides unset. All thirteen application-source/metadata hashes match the committed head after the run; the working tree remains clean, and no test Gateway listener remains. The five failed files and all other results are listed below. Their main-control classification is recorded in Validation.The three wholly skipped files are the desktop-resize fixture, deferred-steer custody fixture and explicitly opt-in live-provider proof. The fourth skipped case is in
ui/src/pages/templates/creator-review.e2e.test.ts, whose other cases pass. No live-provider credentials were added for this synthetic run.Full UI e2e: complete file results (889 files)
All file entries below come from the exact-head full run. Within each group, append the shown suffix to each stem under the shown directory. A passing file can contain an individual skipped case.
Failed (1):
extensions/qa-lab/src/, suffix.e2e.test.tsFailed (4):
ui/src/e2e/, suffix.e2e.test.tsSkipped (3):
ui/src/e2e/, suffix.e2e.test.tsPassed (3):
extensions/qa-lab/src/, suffix.e2e.test.tsPassed (1):
ui/src/, suffix.e2e.test.tsPassed (850):
ui/src/e2e/, suffix.e2e.test.tsPassed (1):
ui/src/pages/agents-home/, suffix.e2e.test.tsPassed (1):
ui/src/pages/chat/, suffix.e2e.test.tsPassed (1):
ui/src/pages/chat/components/, suffix.e2e.test.tsPassed (1):
ui/src/pages/cron/, suffix.e2e.test.tsPassed (1):
ui/src/pages/lobsterdex/, suffix.e2e.test.tsPassed (10):
ui/src/pages/plugins/, suffix.e2e.test.tsPassed (1):
ui/src/pages/secrets/, suffix.e2e.test.tsPassed (1):
ui/src/pages/templates/, suffix.e2e.test.tsPassed (9):
ui/src/pages/workboard/, suffix.e2e.test.tsPassed (1):
ui/src/test-helpers/, suffix.e2e.test.ts