Skip to content

fix(ui): restore absolute bundle and boot budgets - #195199

Merged
steipete merged 2 commits into
mainfrom
steipete/perf-micro-control-ui-budget-drift-20260919
Nov 8, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/perf-micro-control-ui-budget-drift-20260919

Conversation

@steipete

@steipete steipete commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes absolute Control UI bundle and boot budgets failing on main even when base-relative PR checks pass.

User Impact

The same connection, recovery, and translated Chat UI ships fewer document, CSS, and boot JavaScript bytes. No settings, budget ceilings, or CI policies change.

Why This Change Was Made

#194070 embedded independently hashed namespace filenames for all 22 translated locales in every document. Namespace data now shares an immutable content generation per language, keeping the same 14 parallel Chat preload requests with compact metadata. A namespace change invalidates that language's namespace set; base catalogs and config hints keep independent chunk identities. This avoids the extra network round trip observed when deferring the hints.

The runtime connection screen reuses the self-contained document's mascot styles and wordmark definitions, removing duplication introduced by #191935. Unused internal theme variables are deleted, and document compaction removes indentation while preserving visible spacing and preformatted content. Recovery retains the shared SVG host when replacing the body.

Production LOC: −152. The build-only generation and markup work adds 49 lines, offset by removing duplicate rendering/style data. Total deferred JavaScript raw size grows 193,164 bytes while gzip falls 86,130 bytes.

Recommendation for a separate change: CI should run the absolute checker alongside base-relative checks, because acceptable deltas can accumulate beyond fixed ceilings. This PR does not change CI policy.

Evidence

Baseline: main 8b16683b5982f987dea6bd2556b56bc92c66cc11. Production build and absolute checker pass with unchanged limits. Values are normalized bytes from pnpm ui:check-performance --module-attribution.

Metric Before After Limit
Document gzip 15,933 13,715 13,893
Largest JS gzip 564,384 563,656 564,484
Total CSS gzip 325,458 325,045 325,109
Total CSS raw 1,676,130 1,673,862 1,675,754
Chat boot JS gzip 1,296,593 1,295,865 1,296,751
New boot JS gzip 803,310 802,582 803,250
Startup JS gzip 90,865 90,865 91,484
Startup CSS gzip 39,014 38,690 51,200

Locale/build tests pass (50 + 20), fallback tests pass (32), component/theme tests pass (30), and theme browser tests pass (2). Connection, locale/offline retry, and failed-guidance E2E pass (3 + 3 + 1). The namespace generation regression fails on the parent implementation; the SVG recovery regression failed before its fix. Final built Chromium/WebKit proof has 44 pixel-identical mascot/wordmark comparisons and 32 identical computed-style permutations. Codex autoreview is clean at P0–P2.

Production-shaped synthetic UI (1,000 sessions, 500 cron jobs, 400 transcript messages), using production HTTP assets and synthetic RPC: all 90 English/German/Arabic cold-boot samples pass across localhost and 100 ms RTT, with base/candidate/base A/A controls. Readiness medians stay within 2%; renderer CPU has no meaningful increase. Separate sampled allocation medians B/H/A are English 95.04/89.74/90.11 MiB, German 92.89/90.50/94.37 MiB, Arabic 93.66/93.42/97.76 MiB. These are whole-renderer estimates, not exact allocation counts.

The focused 20-pair Arabic localhost follow-up passed all 60 samples: readiness median B/H/A 413.8 / 412.5 / 411.5 ms, p95 421 / 422.7 / 419.6 ms, CPU median 484.1 / 479.2 / 477.5 ms. The tail regression did not reproduce; no overall speedup claim is needed for this byte-budget fix.

Follow-up rebased onto main 34d5b3fd2911a25dbb97f791e3161a999b0fa130. Fresh production build and absolute budgets pass; scoped lint and Codex autoreview pass. Current focused proof: locale/fallback 82 tests, ClawHub Chromium/WebKit 8 tests, retention consumers 39 tests, and connection E2E 1 test. Production typechecks and all core test-type shards pass locally.

Original CI red Disposition
check-prod-types Main's 34d5b3fd restores the missing retention helpers; production typechecks now pass.
check-test-types-* The rebase exposed one remaining missing export, expectLiveObjects, used by three existing retention suites. Restored that export; all core type shards and all 39 consumer tests pass.
checks-fast-baseline-ratchets Removed redundant fixture setup, duplicate payload checks, and the literal animation-count assertion; merged the recovery-artwork check into its existing lifecycle test. Total 6,577,567, ceiling 6,577,567, zero slack. No allocation or ceiling increase.
checks-ui (1/3) WebKit's ClawHub footer assertion sampled the native 150 ms opening scale transition. On isolated main, a frame-crossing diagnostic reproduced the mismatch; awaiting the transition removed it. The test now waits for native animations, then asserts the exact footer position after scrolling and a frame. Both browser suites pass. The assertion originated in #172559 (1adb2047bdf8).

The original unmodified main WebKit case passed 20 repeated local runs; the controlled frame-crossing reproduction identifies the intermittent timing precondition rather than claiming those green replays proved a fix. The revised test retains exact geometry assertions. Test-line growth is now +37 instead of +68 (plus +3 lines in the existing retention helper's formatted export). No runtime UI code changed in this CI repair.

Focused local test wall times: locale/fallback 5.20 s; ClawHub Chromium/WebKit 6.94 s; retention suites 61.67 s including compiler setup (58.40 s Vitest, 92% transform); connection E2E 17.31 s. The failed CI UI step took 101.49 s across 73 WebKit files; only its failing owner was rerun locally. All previously red gates are now green on head f5ca8222f4d26e37348e799b8395b4a08fb46f29: production types, aggregate test types, all five core type stripes, baseline ratchets, and all three UI shards including WebKit. Exact-head CI run. Broader E2E jobs are still finishing; no merge performed.

Synthetic connection screen before:

Before: connection screen

After:

After: same connection screen

@clawsweeper

clawsweeper Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-08T12:16:29.537354Z f5ca822 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui scripts Repository scripts size: L labels Nov 8, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 8, 2026
@clawsweeper

clawsweeper Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR shrinks Control UI locale metadata, shares startup artwork and styles, and removes unused CSS without raising performance limits.

Example: Open translated Chat after a production build.

  • Before: The document measures 15,933 gzip bytes against a 13,893-byte ceiling.
  • After: The reported document measures 13,714 gzip bytes while retaining 14 parallel locale preload requests.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful production reduction with supplied browser proof, held by a definite test-budget failure.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): Inspected before/after phone captures show preserved connection artwork; supplied production-HTTP English, German, and Arabic boot results and absolute-byte measurements cover locale generation and budget restoration.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Control UI navigations download avoidable startup bytes while absolute artifact budgets remain exceeded.
Reason: The maintainer-authored direction has measurable byte savings and retains the established connection, recovery, and localization behavior.

Merge readiness

⛔ Needs changes before merge - 1 item remains

This PR makes a useful budget repair, but its unallocated test growth introduces a concrete CI blocker.

Priority: P2
Reviewed head: fa0127219b58dedd400583fd811c2a93e5298888

Before merge

  • Allocate the retained regression-test growth (P2) - These additions contribute to +68 net test lines without a corresponding allocation. At the pinned head, tracked tests contain 6,576,629 LF lines against an effective ceiling of 6,576,599; the parent has 38 lines of headroom, so this PR newly exceeds the ceiling by 30. The checker returns failure for this positive delta, matching the failed test-line CI annotation. Add a justified allocation for the retained growth under config/test-lines-allocations/, keeping the shared scalar unchanged, or consolidate equivalent coverage until the gate passes.

Findings

  • [P2] Allocate the retained regression-test growth — ui/src/app/vite-config.node.test.ts:703-705
Agent review details

How this fits together

The UI build converts translation catalogs, HTML, and styles into browser assets consumed by Chat, connection screens, and startup recovery.

flowchart LR
  Catalogs[Translation catalogs] --> Build[UI build]
  Document[Startup document and styles] --> Build
  Build --> Assets[Immutable browser assets]
  Assets --> Browser[Control UI browser]
  Browser --> Chat[Translated Chat]
  Browser --> Recovery[Connection and recovery screens]
Loading

Technical review

Best possible solution:

Keep the focused production reduction and fund its retained regression coverage with an exact, justified test-line allocation.

Do we have a high-confidence way to reproduce the issue?

The reported absolute-budget overages are supported by the supplied build measurements; the introduced test-budget failure is independently reproducible from tracked LF counts and the checker's failure condition.

Is this the best way to solve the issue?

The production change uses existing build and presentation owners, preserves parallel locale loading, and removes duplicate data without adding runtime machinery.

Full review comments:

  • [P2] Allocate the retained regression-test growth — ui/src/app/vite-config.node.test.ts:703-705
    These additions contribute to +68 net test lines without a corresponding allocation. At the pinned head, tracked tests contain 6,576,629 LF lines against an effective ceiling of 6,576,599; the parent has 38 lines of headroom, so this PR newly exceeds the ceiling by 30. The checker returns failure for this positive delta, matching the failed test-line CI annotation. Add a justified allocation for the retained growth under config/test-lines-allocations/, keeping the shared scalar unchanged, or consolidate equivalent coverage until the gate passes.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.93

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against c0645d898354.

Provenance checked

  • Locale preload metadata and namespace identity changes intended behavior with a stated reason (caaff17: Start translated Chat catalogs in parallel and prevent an enabled English composer flash; this PR explains the broader per-language invalidation tradeoff used to compact those hints.)
  • Connection mascot and wordmark keeps the original intent (dd11a9c: Keep Gateway downtime visible in the normal shell with the approved mascot, responsive branding, and recovery behavior.)
  • Self-contained startup recovery keeps the original intent (2874436: Provide branded recovery even when external app assets fail, preserving bounded retries and reduced motion.)
  • Production document compaction keeps the original intent (aa75d20: Reduce document transfer without moving fallback assets behind requests or changing recovery presentation.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm check:test-lines-ratchet --base 8b16683
  • git diff --check

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit caaff17 adds ui/config/control-ui-locales.ts:142 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: caaff17579aa; files: ui/config/control-ui-locales.ts)

PR surface

Source -152, Tests +68, Docs +9. Total -75 across 19 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 14 139 291 -152
Tests 4 102 34 +68
Docs 1 9 0 +9
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 19 250 325 -75

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Production versus test growth Production -152 LOC; tests +68 LOC Production shrinks through shared artwork and styles; added coverage protects immutable locale URLs, recovery artwork, and browser rendering, but lacks the required allocation.

Labels

Label changes:

  • add P2: Restoring fixed UI asset budgets is a bounded improvement with a narrow CI repair remaining.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: Restoring fixed UI asset budgets is a bounded improvement with a narrow CI repair remaining.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 8, 2026, 6:58 AM ET / 11:58 UTC.

Compact early locale metadata without adding a request wave, share recovery artwork and mascot styles, and remove unused internal CSS. Preserve connection, translated Chat, and offline recovery behavior with unchanged budget ceilings.
Restore expectLiveObjects for its existing retention consumers after the main conflict repair. Wait for the native dialog transition before comparing footer geometry, and consolidate the budget regressions to fit the unchanged test-line ceiling.
@steipete
steipete force-pushed the steipete/perf-micro-control-ui-budget-drift-20260919 branch from fa01272 to f5ca822 Compare November 8, 2026 12:13
@steipete
steipete merged commit b32f01a into main Nov 8, 2026
144 of 145 checks passed
@steipete
steipete deleted the steipete/perf-micro-control-ui-budget-drift-20260919 branch November 8, 2026 12:31
@steipete

steipete commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

Landing note: ClawSweeper's P2 "allocate the retained regression-test growth" applied to the earlier head. At the merged head f5ca822, redundant test coverage was removed instead of adding an allocation; checks-fast-baseline-ratchets passed with test lines exactly at the ceiling (6,577,567 / 6,577,567), and all other exact-head checks were green.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 9, 2026
* fix(ui): restore absolute bundle and boot budgets

Compact early locale metadata without adding a request wave, share recovery artwork and mascot styles, and remove unused internal CSS. Preserve connection, translated Chat, and offline recovery behavior with unchanged budget ceilings.

* fix(test): restore retention checks and stabilize modal geometry

Restore expectLiveObjects for its existing retention consumers after the main conflict repair. Wait for the native dialog transition before comparing footer geometry, and consolidate the budget regressions to fit the unchanged test-line ceiling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: L status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant