Repository navigation
fix: restore installed package entry headroom - #182279
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 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 changes before merge. What this changesThis PR omits small or non-beneficial Control UI compression sidecars while preserving startup compression and accounting for identity fallback. Example: Install the canonical package globally on Linux arm64 with Node 24.22.1 and npm 11.19.1.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep this PR: it provides useful package headroom through a focused compression change, but existing build tests must be migrated to the new optional-sidecar contract before merge. Priority: P2 Before merge
Findings
Agent review detailsHow this fits togetherVite produces the packaged Control UI assets and compression sidecars; the performance checker measures their transfer costs, and the Gateway negotiates available representations for browser requests. flowchart LR
A[UI source and emitted HTML] --> B[Vite output owner]
B --> C[Original assets and useful sidecars]
C --> D[Installed package budget]
C --> E[Performance checker]
C --> F[Gateway representation selection]
F --> G[Browser]
Technical reviewBest possible solution: Retain the selective compression policy and migrate the existing build tests without weakening asset integrity, output-directory, or progress-reporting coverage. Do we have a high-confidence way to reproduce the issue? Source confirms unconditional sidecar generation and the installed-entry guard, while the supplied paired installs establish the reported budget failure; this read-only review ran no target code. Is this the best way to solve the issue? The approach removes unnecessary package entries at their existing producer, shares the startup parser across consumers, and preserves the encoders and budgets; the incomplete test-consumer migration is the concrete defect. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f6f3874cdc09. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource +49, Tests +93, Docs +6, Other -27. Total +121 across 8 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 24, 2026, 1:56 AM ET / 05:56 UTC. |
Assert only useful per-encoding sidecars for startup, deferred, CSS, and plugin assets. Count single-encoding compression progress and keep build fixtures independent of local plugin artifacts.
… assets (openclaw#182279) * fix: trim small Control UI compression sidecars * test(ui): finish precompression threshold contract cutover Assert only useful per-encoding sidecars for startup, deferred, CSS, and plugin assets. Count single-encoding compression progress and keep build fixtures independent of local plugin artifacts.
What Problem This Solves
Fixes fresh npm installs exceeding the 47,500-entry packaging guard and leaving too little headroom below shipped updaters' 50,000-entry walk limit.
User Impact
Installed packages contain 2,662 fewer Control UI entries while preserving every original asset and the startup transfer budgets. Small deferred assets without sidecars are served as identity by the Gateway's existing fallback; CSS and initial startup assets retain useful compression.
Why This Change Was Made
The Vite output owner emitted gzip and Brotli siblings even for tiny assets and representations larger than the original. Require 4 KiB for ordinary assets, exempt all CSS and the initial startup set, and retain each encoding only when strictly smaller. The startup exemption uses the same extracted final-HTML asset list as the performance gate, with route-only preload templates excluded.
The performance checker now measures identity bytes when a sibling is absent, matching the existing static server. The startup parser is shared with the build and its existing E2E consumer. All package/performance limits, dependencies, encoders and chunking remain unchanged. No runtime server changes are needed.
Evidence
Fresh Linux arm64 global installs from canonical packed tarballs, using Node 24.22.1 / npm 11.19.1 and the unmodified installed-tree checker:
The change itself removes 2,662 entries. The observed total reduction is 2,664: this pack also omits
scripts/README.mdand generatednode_modules/@openclaw/ai/dist/mistral.LICENSE, whose owners are untouched. Those two files are excluded from the savings claim and warrant separate artifact follow-up; restoring both still yields 46,435 entries. The candidate tarball is validation evidence, not a publication artifact.Both previously failing performance gates pass on the built and installed trees:
memory-coreat runtime, and shuts down cleanly. Installedopenclaw --versionsucceeds.Reproduction and artifact identity
Build each revision with
node scripts/package-openclaw-for-docker.mjs --output-dir <artifact-dir>, waiting for final tarball integrity and normalization. Install into an empty global prefix insidenode:24.22.1-bookworm-slim:Base source:
990a389cf6e2f6769ad9240a69e7f91ca21e37f8.Baseline tarball SHA256:
29ca461eef933b182ff846fbbd1aa9566954b3d6fa5030cf6a462f4093bd8aa9.Candidate tarball SHA256:
988cfb758e5fb16616233fdfb0dc9f46016e002c12a7cf770557f5d9adcf2f8f.Unchanged budget checker SHA256:
026c59558c9517de215f1b670186218378fdbe970f6cdd6f73ae3e860db0b22d.CI contract cutover
The finalization and plugin distribution tests now assert optional per-encoding sidecars. The fixture's 18-byte CSS becomes 20 bytes with Brotli and 38 with gzip, so both are correctly absent. The small startup runtime keeps only Brotli. Plugin assets use the same Vite compression owner: deferred JavaScript below 4 KiB and unprofitable CSS remain identity-only; added fixture assets verify useful large JavaScript and sub-threshold CSS still round-trip through both encodings.
The progress test now counts assets with either encoding. Its plugin inventory is rooted in the temporary fixture instead of local built plugins, and its synthetic progress assets exceed the threshold. No production behavior, dependency, or budget changes accompany this follow-up.
Exact focused reproduction, using the default pinned Bun runtime:
Before: 6 failed / 15 passed (119.06 seconds Vitest duration). After: 21 passed (27.23 seconds Vitest duration; 29.43 seconds wrapper wall time). These files exercise actual Vite builds, output overrides, final emitted bytes, plugin publication, and the development server. PR CI supplies broader coverage and CI timing.
Follow-up validation: targeted UI-app test typecheck through
tsrs, oxlint, formatting, and whitespace checks pass.pr-simplifyis complete and independent autoreview is clean at P0–P2. The cutover commit changes only two test files (+77/-31); production behavior is unchanged.