Repository navigation
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 shares gzip level selection between Control UI sidecar generation and normalized performance measurements. Example: Measure the normalized boot JavaScript fixture where gzip level 10 beats level 12.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current-main compression-policy mismatch without changing shipped asset selection; no actionable patch defect was found, while broader CI failures remain unattributed. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherVite generates compressed Control UI sidecars, while the performance collector recompresses hash-normalized assets to evaluate budgets; both now consume the same gzip selector. flowchart LR
A[Built assets] --> B[Vite sidecar producer]
A --> C[Hash normalizer]
C --> D[Budget measurement]
B --> E[Shared gzip selector]
D --> E
E --> F[Compressed bytes]
D --> G[Performance gate]
Technical reviewBest possible solution: Keep one gzip selector for sidecar generation and normalized measurement while retaining existing budgets and compression eligibility. Do we have a high-confidence way to reproduce the issue? Current-main source directly shows the mismatched selectors, and the supplied fail-first fixture records the expected discrepancy; this read-only review ran no target code. Is this the best way to solve the issue? The shared selector is the smallest complete fix for the reported mismatch, removes duplicated policy, and preserves the existing build output contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 800bd59c1a3a. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +10, Tests +37. Total +47 across 3 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. 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 November 16, 2026, 3:18 PM ET / 20:18 UTC. |
7b9674a to
9d34a02
Compare
What Problem This Solves
Fixes: the Control UI performance gate reports boot JS gzip growth that the shipped build does not have, because it recompresses hash-normalized boot assets at libdeflate level 12 only while the build ships the smallest of levels 10, 11 and 12.
User Impact
No user-visible change. Maintainers and contributors get a performance gate whose normalized boot gzip numbers follow the same compression policy as the shipped sidecars, so a change that shrinks shipped gzip no longer fails boot budgets because of compressor-level noise. Budgets, hash normalization, identity fallback, Brotli settings and code splitting are unchanged.
Why This Change Was Made
createControlUiPrecompressedAssetVariants(ui/vite.config.ts) picked the smallest gzip of levels 10/11/12 for boot assets and level 12 for deferred assets.measureControlUiBudgetAsset(ui/config/control-ui-asset-compression.ts) receivedcompression.bootbut always used level 12 when normalization changed the text, and the served sidecar size when it did not, so the measured policy depended on whether normalization touched the asset. Both paths now call one selector,gzipControlUiAsset(body, boot).Observed on #200145 (4be2dde vs b307684, two identical paired Studio builds): shared boot JS raw +53 B, shipped gzip -384 B, normalized budget gzip +729 B, with identical chunk and module inventories. #200145 depends on this PR.
Evidence
ui/src/app/vite-precompression.node.test.ts): measures a hash-normalized fixture where level 10 beats level 12 and asserts boot, deferred and ineligible (identity) measurements equal what the build ships. On main sources it fails withexpected 5460 to be 5432(level-12 measurement vs shipped boot sidecar); with this change it passes. Reproduced locally and in the container below.48cd549b1c48653061ec312e35fef62d13df62cf):pnpm test ui/src/app/vite-precompression.node.test.ts ui/src/app/vite-config.node.test.ts test/scripts/control-ui-performance.test.ts→ 102 tests passed; with main'sui/config/control-ui-asset-compression.tsandui/vite.config.tsthe parity test fails again (expected 5460 to be 5432).local-container, imagenode:24.22.1-trixieruntime_image_idsha256:f1e034976f948cf212ef1f659c12e5dd58ac7eab947831813e81a62401ca38be, Node v24.22.1, 8 CPU / 24 GiB,--no-hydrate): leasecbx_f3fafd504399(run_bc538d6712fc108889e25da14415f77d), HEAD9d34a02905360ee3e104b6c2b18a49009d3d4209, commandcorepack pnpm install --frozen-lockfile --store-dir .pnpm-store; corepack pnpm test ui/src/app/vite-precompression.node.test.ts; corepack pnpm ui:check-performance:base 48cd549b1c48653061ec312e35fef62d13df62cf→ parity test 2/2 passed, gate exit 0, total 3m34s, lease stopped. Chat boot JS 1,323,907 → 1,323,751 B (−156; limit 1,324,691), new-page boot 815,710 → 815,554 B (−156; limit 816,160), largest JS 558.5 KiB (limit 559.0), startup JS and CSS unchanged.7b9674ac(same image and recipe): leasecbx_2cc06ff303e6showed the parity test passing on the branch and failing with main's sources, andui:check-performance:base 9e66164cexit 0. Leasecbx_10eff13acc0dran feat(openclaw-id): members can recover access with a recovery kit #200145's3e7e9f0plus this fix (scratch branchscratch/ocf-552-perf-parity-3e7e9f0, HEADbc2aad92):ui:check-performance:base b307684→ exit 0. That pair previously failed (+729 B normalized; over the largest-JS, chat and new-page caps by 205, 234 and 142 B). With the fix: chat boot JS 1,312,699 → 1,313,109 B (+410; limit 1,313,246), new-page boot 815,218 → 815,628 B (+410; limit 815,806), largest JS 558.6 KiB (limit 558.7).Review notes
Independent review found no P0–P2 issue in this diff. It noted a pre-existing, separate gap: the gate derives boot assets from
index.htmlonly, while the build also treats login-only chunks (routes.login, deliberately absent from the HTML) as boot for compression. Those chunks are not part of the chat/new boot totals; aligning that classification needs the gate to learn the login route set and is left as a follow-up rather than widened into this fix.🦞 Made with OpenClaw