Skip to content

perf(ui): reclaim Chat boot bytes and lower budgets - #194135

Merged
steipete merged 9 commits into
mainfrom
solid2/w-perf-chat-budget-paydown-1106
Nov 6, 2026
Merged

steipete merged 9 commits into
mainfrom
solid2/w-perf-chat-budget-paydown-1106

Conversation

@steipete

@steipete steipete commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Chat boot had accumulated small, justified byte increases. This pays back 1,647 B normalized gzip without moving a lazy boundary or changing the UI, and brings total CSS below its ceiling with lower caps.

User Impact

Chat loads fewer bytes with the same requests, controls and layout. Remove 94 unused English keys, 13 aliases, obsolete base64 fallbacks below the supported browser floor, unused emitted redaction/queue initialization, and retired CSS selectors/browser fallbacks. Live redaction, persisted queue normalization and reduced-transparency preferences retain their behavior.

The closure audit ranked modules, function spans and strings. Required Markdown/entity tables, runtime code and plugin-addressable icons remain. No dependency or runtime abstraction was added.

Evidence

Final matched-inventory production builds against current main 59b8a114bf6dede71999976ddc87fd3edf382c85, on the same machine with Node 26.12.1. Both builds use 37 byte-identical native-plugin artifact inputs. Generated names are normalized by the checker from #193843. These numbers supersede the earlier base and unmatched-inventory measurements.

Surface Base Head Change New cap
Chat boot JS gzip 1,289,681 B 1,288,034 B −1,647 B 1,288,098 B
New Session boot JS gzip 798,642 B 797,475 B −1,167 B 797,539 B
Initial JS gzip 90,316 B 89,622 B −694 B baseline 89,622 B
Total CSS gzip 324,666 B 324,620 B −46 B 324,684 B
Total CSS raw 1,676,053 B 1,675,318 B −735 B 1,675,382 B

Fixed caps are measured head + 64 B and below main's caps; initial JS retains the existing growth/variance policy. Requests are unchanged: Chat 20 JS/3 CSS, New 15/3, initial 3/1. The paired strict check passes. Main's largest-JS overage also shrinks, 560,877→560,404 B; its 560,350 B cap remains unchanged.

  • Production builds, paired strict normalized check, UI typecheck, focused lint/stylelint/format, i18n baseline, production Knip and diff checks pass.
  • Focused base64 22, redaction 18, queue 4 and sidebar 34 tests pass. Both two-tab deletion E2E cases pass. The transient-surface file passes 9 cases in each of Chromium and WebKit; WebKit is rechecked after main integration.
  • Current-base visual proof: 16 states, 1,383 node observations and 1,206,707 computed-property comparisons across Chromium/WebKit, with zero geometry/style/structure differences. Communications retains its generated tab class and both 24px gaps.
  • Independent reviews of the original change, each repair and the final main integration found no actionable P0–P2 issues. No timing campaign: this deletes unused work and cancels a stale callback; no code crosses a lazy boundary.

Touched production LOC 24,311→24,125; tests 1,751→1,778; budgets 838→837. Total 26,900→26,740 (−160), 35 files, +92/−252. Reports and build artifacts are not committed.

Inspected synthetic before/after frames from the final matched builds:

Desktop before Desktop after
Desktop before Desktop after
Mobile before Mobile after
Mobile before Mobile after
Communications desktop before Communications desktop after
Communications desktop before Communications desktop after
Communications mobile before Communications mobile after
Communications mobile before Communications mobile after

CI repairs

The first full run caught a 16px Communications spacing regression: HubTabs generated a live class missed by the initial audit. Both rules are restored and current-base visual proof preserves 24px gaps. A later real-Gateway catalog failure reproduced an unanswered old-page request surviving reload in test tracking; request/reply tracking now resets at the replacement WebSocket, while acquisition counters remain cumulative.

Run 42228358362 exposed a pending sidebar capture that could write a deleted row back before the local roster caught up. Twenty baseline replays passed, so no inherited waiver is claimed. A deterministic persisted-row regression is red before the two-line cancellation fix and green afterward; surviving rows and later live captures remain intact. Run 42231765596 passed those repairs and both real-Gateway shards. Its only failure was WebKit reading the menu's 0.95 entry scale as a 5.70px gap. The test now finishes finite animations before checking the unchanged 6px spacing and click/modal behavior. Production assets are unchanged by that test repair.

Current main was merged to resolve shared cap-line conflicts, and the final production measurements and visual comparisons were refreshed. Final candidate: 62eaf3dade84b94ab3ad337c9b8a799a1a5750c7. Full CI passes in run 42241605609.

Run 42235412032 passed the test jobs; its test-line ratchet found the net 11 regression-test lines one line above the remaining shared allowance. A unique 27-line allocation records the justified persisted-row, geometry and publication-settlement coverage after redundant fallback-test removal; the shared scalar is unchanged. The exact ratchet now passes. This metadata-only final commit leaves production assets and prior proofs unchanged.

Run 42237346426 passed all jobs except the catalog real-Gateway case. Its trace showed a passive publication read arriving during the no-new-request assertion after a forced Refresh. The idle check now accounts for queued catalog invalidations until a read starts, then waits for outstanding replies. The strict request and provider-acquisition assertions remain unchanged; no sleep or product change was added. All three catalog tests pass locally (31.06 s test time; 298.32 s wall including cold prerequisite builds), using Node 26.12.1 for Playwright. UI types, lint, formatting, the exact 27-line allocation and independent review pass. The same test passed on scheduled main run 42233981965, so no inherited exception is claimed. Full CI passes for the replacement head in run 42241605609, with no inherited-failure waiver.

Remove retired English copy, obsolete browser fallbacks, and unused emitted initialization. Preserve layout and behavior while reducing normalized Chat boot by 1,741 B and total CSS by 158 B; ratchet measured caps with 64 B headroom.
@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Nov 6, 2026
@clawsweeper

clawsweeper Bot commented Nov 6, 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 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T15:20:01.269594Z 62eaf3d 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.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 62eaf3dade84b94ab3ad337c9b8a799a1a5750c7
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • packages/acp-core/src/structured-auth-redaction.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/logging/redact-patterns.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.

Carefully review these changes before merging.

@steipete
steipete enabled auto-merge (squash) November 6, 2026 13:11
@steipete
steipete disabled auto-merge November 6, 2026 13:17
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Nov 6, 2026
@clawsweeper

clawsweeper Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR removes unused English copy, retired styles, obsolete browser fallbacks, and unused initialization, then lowers Control UI size budgets.

Example: Open Chat from a production build.

  • Before: Normalized boot JavaScript measures 1,289,586 B gzip.
  • After: It measures 1,287,845 B gzip with the same request counts and captured layout.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, compact deletion work with inspected browser proof and no identified defect; the exact-head CI failure remains unclassified.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The production Control UI byte measurements exercise the changed build output, and inspected desktop/mobile browser captures show preserved Chat and attachment-menu presentation; the body separately records Chromium/WebKit style parity and the Communications repair.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Chat downloads catalog entries, initialization, and styles that its supported runtime no longer needs.
Reason: The maintainer-authored direction produces measurable savings with less production code and preserves existing owners and supported-browser behavior.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR provides a measured byte reduction with no identified code defect; its current-head CI gate remains failed.

Priority: P3
Reviewed head: 8f84c174a93e8a25610c93331d291fb322decf61

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Control UI build bundles browser code, English catalogs, and styles into assets served by the Gateway; the performance checker measures those assets against committed ceilings.

flowchart LR
  A[English catalogs] --> D[Production UI build]
  B[Browser utilities] --> D
  C[Shared styles] --> D
  D --> E[Gateway served assets]
  E --> F[Chat browser]
  D --> G[Performance checker]
Loading

Technical review

Best possible solution:

Land the deletion-based paydown and lower budgets after the current-head CI failure is classified and the required gate is satisfied.

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

This is a measured size paydown rather than a functional bug report; the PR supplies paired production-build measurements, and no target code was executed during this review.

Is this the best way to solve the issue?

The invariant is unchanged supported-browser behavior with fewer emitted bytes; deleting unused paths through existing owners and ratcheting their budgets is the smallest complete approach.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Base64 browser fallbacks changes intended behavior with a stated reason (e7e2592: Preserve conversion behavior for older browsers admitted by the capability gate.)
  • Performance budgets keeps the original intent (00ddcde: Measure code growth independently of generated asset-name noise while preserving strict ceilings.)
  • English catalog fragments keeps the original intent (e42e9b5: Keep feature copy with lazy consumers while retaining shared labels and namespace anchors.)
  • Viewport CSS keeps the original intent (cbc0f01: Keep mobile content within safe areas using dynamic viewport geometry.)
  • Retired Advanced accordion icon selector keeps the original intent (23fe9d1: Replace decorative accordion icons with ordinary Settings navigation rows.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source -188, Tests -33, Other -2. Total -223 across 30 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 27 14 202 -188
Tests 1 7 40 -33
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 8 10 -2
Total 30 29 252 -223

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 tests Production −188 LOC; tests −33 LOC The reduction removes retired paths and fallback-specific test setup without introducing replacement machinery.

Labels

Label changes:

  • add P3: This is a bounded asset-size improvement with no established urgent user-facing regression.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is a bounded asset-size improvement with no established urgent user-facing regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

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 6, 2026, 8:41 AM ET / 13:41 UTC.

Retire a pending timer or idle capture when snapshot invalidation removes a session. Otherwise a cross-tab deletion can be followed by a stale live projection that writes the deleted row back into storage before the local roster catches up.

Keep the two-tab write budget unchanged. Add a persisted-row regression that fails before the fix; all 34 owner tests and both deletion E2E cases pass. The repair adds 3 B normalized gzip and retains a 1,829 B Chat boot saving; ratchet caps to the final measurements plus 64 B.
WebKit CI observed the menu's 0.95 entry scale, turning the correct 6px gap into a transient 5.7px rectangle gap. Finish finite menu animations with the existing helper before measuring static geometry; retain the exact spacing, clickability, and modal assertions.

All nine transient surface cases pass in Chromium and WebKit. UI types, focused lint/format, and independent review pass. Production bundles are unchanged.
Merge current main and retain the byte-paydown changes. Matched native-plugin inventory builds against 59b8a11 measure Chat 1289681 -> 1288034 B, New Session 798642 -> 797475 B, and CSS 324666 -> 324620 B normalized gzip. Ratchet those caps to measured head plus 64 B, below main's caps.

Keep the largest-JS cap unchanged: its inherited overage shrinks by 473 B. The paired strict check passes. Current-base Chromium/WebKit proof covers 16 states and 1206707 computed properties with no differences. Types, production Knip, the WebKit transient suite and fresh independent review pass.
Record the 11 net test lines for the persisted-row resurrection regression and native-menu geometry settlement after removing redundant base64 fallback coverage. Keep the shared test-line scalar unchanged.

The exact test-line ratchet and independent review pass. This is metadata only; production assets and prior behavior proof are unchanged.
Track observed catalog invalidations until the corresponding read starts, then retain the existing reply and no-new-request assertions. This covers the publication coalescing window without arbitrary sleeps or product changes.

The scoped test allocation now covers 27 net regression-test lines, including 16 lines for publication settlement.
@steipete
steipete merged commit 9a5ecd3 into main Nov 6, 2026
141 of 143 checks passed
@steipete
steipete deleted the solid2/w-perf-chat-budget-paydown-1106 branch November 6, 2026 15:40
@steipete

steipete commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 7, 2026
* perf(ui): reclaim Chat boot bytes and lower budgets

Remove retired English copy, obsolete browser fallbacks, and unused emitted initialization. Preserve layout and behavior while reducing normalized Chat boot by 1,741 B and total CSS by 158 B; ratchet measured caps with 64 B headroom.

* fix(ui): preserve Communications tab spacing

* test(ui): scope catalog idle checks to the current socket

* perf(ui): ratchet caps against complete plugin builds

* fix(ui): cancel scheduled sidebar captures on deletion

Retire a pending timer or idle capture when snapshot invalidation removes a session. Otherwise a cross-tab deletion can be followed by a stale live projection that writes the deleted row back into storage before the local roster catches up.

Keep the two-tab write budget unchanged. Add a persisted-row regression that fails before the fix; all 34 owner tests and both deletion E2E cases pass. The repair adds 3 B normalized gzip and retains a 1,829 B Chat boot saving; ratchet caps to the final measurements plus 64 B.

* test(ui): settle menu entry animation before spacing checks

WebKit CI observed the menu's 0.95 entry scale, turning the correct 6px gap into a transient 5.7px rectangle gap. Finish finite menu animations with the existing helper before measuring static geometry; retain the exact spacing, clickability, and modal assertions.

All nine transient surface cases pass in Chromium and WebKit. UI types, focused lint/format, and independent review pass. Production bundles are unchanged.

* test(ui): allocate sidebar regression coverage

Record the 11 net test lines for the persisted-row resurrection regression and native-menu geometry settlement after removing redundant base64 fallback coverage. Keep the shared test-line scalar unchanged.

The exact test-line ratchet and independent review pass. This is metadata only; production assets and prior behavior proof are unchanged.

* test(ui): await queued catalog publications before picker checks

Track observed catalog invalidations until the corresponding read starts, then retain the existing reply and no-new-request assertions. This covers the publication coalescing window without arbitrary sleeps or product changes.

The scoped test allocation now covers 27 net regression-test lines, including 16 lines for publication settlement.
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 ci:full Keep ordinary native-locale CI selection on the next PR run. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts security-sensitive-changed size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant