Repository navigation
perf(control-ui): defer closed sidebar renderers during reload - #170648
Merged
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Contributor
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. |
steipete
force-pushed
the
steipete/coldload-boot-js-composition
branch
from
October 13, 2026 05:26
d78460a to
e53d000
Compare
steipete
force-pushed
the
steipete/coldload-boot-js-composition
branch
from
October 13, 2026 07:10
e53d000 to
ad58e51
Compare
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 14, 2026
Chat boot JS fell ~100 KB raw / ~25 KB gzip (preload hints 31 -> 30); production -35 LOC. Performance budgets pass; sidebar cold-load e2e passes. Admin-merged over inherited UI e2e failures: every failing CI shard reproduced on the PR base (full AWS suite: 3,373 passed; 6 of 7 failures reproduce on base 9100051, the 7th was a non-reproducing CLI refresh warning). Evidence in the PR body.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
A signed-in reload of a dashboard deep link downloads and evaluates closed sidebar surfaces before the operator uses them. The cold-load campaign's original evidence recorded 14 visual states over roughly 15 seconds; L34 still measured 53 boot JS requests after the earlier improvements.
User Impact
The Inbox badge and sidebar remain available at boot, while the Inbox panel and sidebar popup renderers load through their existing interaction boundaries. Session-menu registration now belongs to the popup renderer that consumes it. No settings, authentication, Gateway records, or schema changes.
Why This Change Was Made
Remove the connection-time Inbox preload, idle sidebar-popup preload, and eager sidebar session-menu registration. Regenerate the measured boot manifest with the existing generator, excluding both optional dynamic entries from route hints and the offline boot inventory. Pointer/focus Inbox prefetch and menu-opening loads remain available; optional chunks need a network connection until first loaded, like other lazy surfaces.
Evidence
Production-bundle Team-scale fixture, one reload per candidate on the same loaded Mac, at UI source base
74c7b3d72589(after the New Session Solid migration). The baseline temporarily substitutes the five changed production UI files from main in this lane's worktree, then restores the reviewed bytes exactly. The UI files at the sampled main revision633acc213daeare identical to that UI base. Byte counts sum emitted JS and shipped gzip sidecars, rather than compressed wire traffic; build identities differ and can introduce small gzip variance. All timing samples are noisy.No reliable evaluate-time or overall reload-speed improvement is claimed: another pair measured evaluation 26.8→20.1 ms, while the starting-base pair measured 21.7→24.0 ms. The demonstrated improvement is fewer boot-hint requests and fewer downloaded JS bytes. New Session also falls from 28 to 27 boot JS hints and from 1,344,712 to 1,300,899 gzip bytes.
Evaluation accounts for
EvaluateScriptandv8.evaluateModuleon the selected renderer main thread; overlapping intervals are counted once. Iframe evaluation is excluded.Source-map attribution found a single production copy of Solid, lit-html, and every other package in the fetched graph. Major vendor contributions before the change: TypeBox ~148 KB, Web Awesome ~126 KB, Zod ~100 KB, highlight.js ~72 KB, Solid signals ~65 KB, markdown-it ~51 KB; startup English ~150 KB. Foreign locale catalogs, Mermaid, terminal/noVNC, and settings page renderers remain lazy. No dependency overrides or runtime-resolution changes are needed. Retired boot code includes the sidebar popup renderer (~11 KB), update card (~10 KB), sidebar session menu renderers (~8.5 KB), and Inbox rendering/helpers.
Focused proof, one file at a time:
pnpm ui:boot-manifest:genand production UI builds through the merged cold-load bench.pnpm ui:check-performance --dist <candidate-bundle>: all enforced budgets pass, chat/New Session 30/27 JS hints (limit 35).pnpm test ui/src/e2e/sidebar-boot-imports.e2e.test.ts --maxWorkers=1: 1 pass, 33.98 s command wall time; source-server request boundary plus visible opened Inbox. Reinstating the original preload in the served module fails the zero-request assertion (1 request before interaction).pnpm test ui/src/components/sidebar-attention.test.ts --maxWorkers=1: 21 pass, 12.37 s command wall time. Move the existing import-settlement wait to the first opening instead of assuming mount preloads it.pnpm test ui/src/components/app-sidebar.sessions.test.ts --maxWorkers=1: 154 pass, 65.93 s.pnpm test ui/src/e2e/sidebar-attention-scope.e2e.test.ts --maxWorkers=1: 1 pass, 49.51 s; bundled Inbox opening, automation scopes, and dismissal.pnpm test ui/src/e2e/mobile-sidebar-session-menu.e2e.test.ts --maxWorkers=1: 6 pass, 76.83 s; actual session menus and shortcuts.pnpm test ui/src/app/control-ui-chunking.test.ts --maxWorkers=1: 5 pass, 12.69 s; grouped route styles and optional-code exclusion. Its fixture now uses remaining shared boot styles, and no longer requires a fully tree-shaken debug contract in the source-map inventory.git diff --checkpass. Independent Codex review completed scoped-clean through P2 before commit.Current head:
ad58e516349c169b5c85afe128161f71865c9c45, rebased onto main3b01cee14cfe.pnpm install --frozen-lockfilepassed, the boot manifest was regenerated, and independent review completed scoped-clean through P2. Main's stronger native-intersection test synchronization supersedes this PR's earlier visibility-test fix.Post-rebase production build: chat boot JS 5,172,047 B raw / 1,604,116 B gzip, 30 requests; New Session 4,197,243 B raw / 1,303,502 B gzip, 27 requests.
pnpm ui:check-performancepasses with no violations. The before/after table above records the earlier controlled pair; these current-head totals include subsequent main changes.The earlier inherited sidebar cold-load regression is fixed on main by #170708. On this head,
sidebar-cold-load.e2e.test.tspasses both tests in 30.15 seconds of Vitest time. Full-suite AWS proof and exact-head CI results follow below.CI run 38361059897, on exact head
ad58e516349c169b5c85afe128161f71865c9c45, completed with 40 successful jobs, three failed UI e2e shards, and their dependent gate failure. Every failing CI case reproduces on pinned base3b01cee14cfeon the same AWS box. No CI rerun or update-branch was used to chase these inherited failures.Full UI e2e proof on AWS Crabbox
cbx_f0f792acb0e7, runrun_b77f34a20b80a2795a59a7ddeab08685:node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --reporter=default --reporter=json --outputFile=<head-report>: 754 files passed, 6 failed, 1 skipped; 3,373 tests passed, 7 failed, 1 skipped. Vitest duration 6,716.60 s. The skipped file is native desktop resize on Linux.3b01cee14cfeon the same lease, with its own frozen dependency install and build: 8 tests passed, 6 failed in 318.68 s. Six head failures reproduce with the same assertions; the activity chunk's generated filename differs between builds.chat-collapsed-reply-reveal.e2e.test.tschat-header-subagents.e2e.test.tschat-position-rail.e2e.test.tschat-reply-preview-recovery.e2e.test.tscontrol-ui-stale-build-reload.e2e.test.tsmodel-api-keys.real-gateway.e2e.test.tsThe API-key result is not claimed inherited or fixed. After base passed, the only additional test run was that failed file on the unchanged head, using the same AWS lease:
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts ui/src/e2e/model-api-keys.real-gateway.e2e.test.ts --maxWorkers=1. It passed in 60.236 s command wall time (runrun_2451c52f90324ebe4ddcbdf0c10902f3). Its full-run CLI refresh warning remains a follow-up; no timeout or expectation was weakened. The remote checkout was verified clean at the exact head after replay.All touched-area e2e cases pass in the full run, including sidebar cold load (2), Inbox latency (2), native-update authority (6), mobile sidebar menus (6), attention scope (1), and the new boot-import regression (1). The boot-import case took 5.32 s in the full run. Final-head chunking units also pass 5/5, 7.26 s command wall time. Initial-connect splash, optional boot requests, and real-Gateway chat-loading performance pass.
Both owned AWS leases were stopped. The earlier lease
cbx_e91aee69ee8efailed workspace adoption before dispatching tests; it supplied no test proof. The PR remains ready, open, and unmerged. The remaining lead handoff is the inherited UI failures and the non-reproduced API-key CLI refresh warning.Production LOC delta (
git diff --stat origin/main...HEAD -- ':!*.test.ts' ':!*test-support*' ':!docs/*'): 41 insertions, 76 deletions, net −35 lines across six files, including the generated manifest and test routing config. Implementation itself is 1 insertion, 6 deletions. The standalone-test classification avoids an unused production build for the source-server regression.Release-note context: reduce Control UI chat reload JavaScript by keeping closed Inbox and sidebar popup renderers out of boot.