Repository navigation
improve(ui): enforce build performance budgets - #106367
Conversation
|
Land-ready at exact head Focused proof:
Mergeability: clean. Required status checks: none; |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c3cb2fd0ae
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "tui:pty:test:watch:fake": "node --import tsx scripts/dev/tui-pty-test-watch.ts --mode fake", | ||
| "tui:pty:test:watch:local": "node --import tsx scripts/dev/tui-pty-test-watch.ts --mode local", | ||
| "ui:build": "node scripts/ui.js build && node scripts/check-control-ui-precompressed-assets.mjs", | ||
| "ui:build": "node scripts/ui.js build && node scripts/check-control-ui-precompressed-assets.mjs && node scripts/check-control-ui-performance.mjs", |
There was a problem hiding this comment.
Enforce budgets for direct UI build callers
When the Control UI is built through pnpm mac:package/scripts/package-mac-app.sh, the macOS packaging path still runs node scripts/ui.js build directly at scripts/package-mac-app.sh:213, so it bypasses the new precompressed-asset and performance-budget checks added only to the ui:build package script. That leaves a production packaging flow able to ship a bundle that violates these budgets; move the checks behind scripts/ui.js build or update the direct caller so all production UI builds hit the same guard.
Useful? React with 👍 / 👎.
Closes #106363
What Problem This Solves
Resolves a problem where Control UI startup request and transfer-size regressions could pass production builds unnoticed, allowing earlier loading improvements to erode without an actionable guard.
Why This Change Was Made
The canonical production UI build now reads startup assets from generated HTML, measures the gzip and Brotli sidecars that OpenClaw actually ships, reports startup, largest-asset, and total bundle metrics, and fails on explicit startup or largest-asset ceilings. The budgets keep modest headroom over the measured optimized baseline; focused tests cover extraction, aggregation, violations, and missing compressed assets.
AI-assisted: yes. The implementation and tests were reviewed with the repository autoreview helper.
User Impact
Future Control UI bundle regressions become actionable build failures before release. This changes build validation only; runtime behavior and visible layout are unchanged.
Evidence
tbx_01kxdnt53pw18kjeqgkzsc5m3d/ run 29248461172: focused performance suite passed, 4 tests.pnpm ui:build: 472 finalized sidecars verified; startup JavaScript 23 requests / 297.0 KiB gzip, startup CSS 1 request / 37.6 KiB gzip, largest JavaScript 188.7 KiB gzip, and largest CSS 37.6 KiB gzip; all budgets passed.pnpm tsgo:test:root: passed..agents/skills/autoreview/scripts/autoreview --mode local: clean; no accepted/actionable findings.