Skip to content

perf(ui): recover chat and New Session boot headroom - #177117

Merged
steipete merged 10 commits into
mainfrom
solid2/w-perf-headroom
Oct 19, 2026
Merged

steipete merged 10 commits into
mainfrom
solid2/w-perf-headroom

Conversation

@steipete

@steipete steipete commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Chat and New Session boot sit too close to their existing performance caps, causing normal feature changes to fail the strict budget.

User Impact

Both routes gain at least 25 KiB of headroom under their unchanged caps. First-paint content, commands, update diagnostics, and menu behavior are preserved. The Plus menu shows a loading row on its first open and offers retry if its chunk cannot load.

Why This Change Was Made

Defer slash-command execution code until dispatch and update-report formatting until a failed or rolled-back run needs it. Recheck the existing target/connection authority after each awaited load. Keep the Menu trigger, native overlay authority, anchor, and override indicator eager, and load entry builders/actions on first accepted open. Preserve current props, row identity after catalog refresh, keyboard focus, pointer focus, and cancellation.

Move cold English copy to existing lazy catalog owners. Shared startup labels stay eager; session-organization copy loads with its consumers. The canonical source catalog preserves every key, value, and flattened order. No dependencies, public APIs, configuration options, or performance caps change.

Evidence

Strict same-machine paired build against cf0ad5cad99bdb339d0cb2239fec9b256c79d82f, using one installed Node/Vite/Pako toolchain and normalized build identity:

Metric Base Head Saved
Chat boot gzip / requests 1,470,510 B / 24 1,454,378 B / 24 16,132 B
New Session boot gzip / requests 1,044,835 B / 19 1,023,718 B / 19 21,117 B
Startup JS gzip / requests — 323,797 B / 7 —
Startup CSS gzip / requests 38,500 B / 1 38,500 B / 1 unchanged
Chat route CSS gzip / requests 126,687 B / 8 126,706 B / 8 +19 B
New Session route CSS gzip / requests 104,074 B / 7 104,093 B / 7 +19 B

Final margins: 35,622 B chat under 1,490,000 B, 26,282 B New Session under 1,050,000 B. Both exceed 25,600 B. The margin includes the merged main changes; the savings column isolates this PR against that main base. Main now permits 1,500,000 B for chat, but this result meets the requested stricter 1,490,000 B cap. This PR does not change either cap. Request counts remain 24 chat and 19 New Session against this base. No stylesheet source changes; route CSS packaging is 19 B larger per route while startup CSS is identical. The JavaScript savings exceed that small packaging cost.

Proof Result
UI typecheck Default tsrs passed
Plus menu targeted files 18 tests passed; delayed load, retry, live props, focus, close/reopen, row identity
Lazy-menu consumer repair 31 targeted assertions passed across attachment, Chromium/WebKit, loading and invalidation tests; exact type leaf and mock-export ratchet passed
Status response ordering regression Red before the sequence guard; all 13 owner tests pass with it
Original failed unit files 87 tests passed after repairs
Initial command/update helper coverage Three changed files passed; command-only test rerun clean after removing irrelevant browser-rAF scheduling
i18n baseline / verify Passed; ordered source-catalog preservation checked
Focused lint / format Passed
Production Knip Passed on the combined final source
Independent autoreview No actionable P0–P2 findings
Synthetic production-bundle capture Code-heavy transcript and opened Plus menu inspected before/after
Full UI CI ci:full; replacement-head run passed on 1c8bfa45ff3: 49 jobs succeeded, 23 skipped

The first CI run (39219794867) exposed genuine missing English registration and update tests that assumed three microtasks completed an asynchronous formatter load. The shared “This computer” label remains eager, Agents registers its recovery copy, and the catalog test uses the complete source catalog. The update tests now wait for published run/report state. Its sole E2E failure was the same Agents recovery label. These were repaired rather than treated as inherited failures.

Production TS/TSX LOC: 17,943 → 18,517 (+574). Test LOC: 4,827 → 5,143 (+316). The growth is explicit lazy catalog registrations and the menu's loading/retry/focus handoff. Entry builders and selection logic were moved unchanged. Solid refactor counts: effects 1 → 1 in the menu; controllers, render effects, untrack, raw addEventListener, querySelector, flush, and owner escapes remain zero. The touched concatenated trigger class was removed.

Published review also identified a real response-ordering race introduced by the deferred formatter. The update owner now rejects an older status projection if a newer response arrived while formatting was pending, alongside its existing connection and authorization checks. The regression holds the formatter while newer status publishes, then verifies the old response never overwrites that state.

The second full CI run (39223696400) exposed additional consumers that read menu entries immediately after open. The test helpers and browser tests now wait for the actual requested entry. The table test narrows its parameter to its five actual cases, and the intentional import-failure mock documents its isolation. The final commit contains only test changes; production sources are identical to the measured build.

The original auto request was confirmed cancelled before replacing its head. Landing uses native exact-head recovery after fresh review/preparation and CI. No cloud leases were created.

Release-note context: reduce Control UI chat and New Session boot downloads while preserving first-paint content and interaction behavior.

Before: synthetic code-heavy transcript

After: unchanged synthetic code-heavy transcript

Before: composer Plus menu

After: lazy composer Plus menu

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 19, 2026
@clawsweeper

clawsweeper Bot commented Oct 19, 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 Oct 19, 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-10-19T08:54:17.515548Z 1c8bfa4 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: XL labels Oct 19, 2026
@steipete
steipete enabled auto-merge (squash) October 19, 2026 08:07

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ddc4c17e09

ℹ️ 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".

Comment thread ui/src/i18n/locales/en.ts Resolved
Comment thread ui/src/app/overlays-updates.ts Resolved
@clawsweeper clawsweeper Bot added the clawsweeper:intake:feature Preliminary submission classification; full source review pending. label Oct 19, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 19, 2026
@steipete
steipete disabled auto-merge October 19, 2026 08:18
@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR defers command execution code, update-report formatting, Plus menu content, and cold English catalogs until needed.

Example: Open the Control UI chat route with the Plus menu closed.

  • Before: The reported production boot download is 1,470,510 gzip bytes.
  • After: The reported download is 1,454,378 gzip bytes; opening Plus loads its content on demand.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Measured bundle savings and production-bundle screenshots support the optimization; focused harnesses cover interaction edge cases, and the previous defects are repaired.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): The supplied paired production-bundle measurements exercise chat and New Session boot, and inspected synthetic browser screenshots show preserved transcript and loaded Plus menu presentation; focused regressions support asynchronous ordering, focus, retry, and stale-target behavior.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Chat and New Session download cold functionality during boot and have little room below their performance budgets.
Reason: Maintainer direction is established, the reported reduction is measurable, and no new public API, option, dependency, or budget increase is introduced.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-directed optimization provides measured boot savings, all four previous findings are resolved, and no new actionable defect was found.

Priority: P2
Reviewed head: 1c8bfa45ff332f8477310701ca22c185f637734d

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Control UI loads route bundles and English catalogs, then dispatches user actions through existing menu, command, and update owners.

flowchart TD
  A[Control UI boot] --> B[Chat and New Session]
  B --> C[Eager triggers and shared labels]
  C --> D[User action]
  D --> E[Lazy content and catalogs]
  E --> F[Existing action owners]
  F --> G[Gateway requests and UI results]
Loading

Technical review

Best possible solution:

Keep cold work behind the existing action owners while preserving eager shared copy, native menu admission, and current-target checks.

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

This is a performance optimization supported by supplied paired production-build measurements; no independent execution was performed during this read-only review.

Is this the best way to solve the issue?

The change removes eager work at existing owners, preserves their contracts, and adds only the loading, retry, focus, and ordering handling needed by the new asynchronous boundaries.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Shakker: Raw commit de9bc99 adds ui/src/pages/chat/chat-commands.ts:128 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: de9bc994c7d8; files: ui/src/pages/chat/chat-commands.ts)

PR surface

Source +558, Tests +316, Other +6. Total +880 across 68 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 51 1970 1412 +558
Tests 16 364 48 +316
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 11 5 +6
Total 68 2345 1465 +880

Labels

Label changes:

  • 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 🐚 platinum hermit and patch quality is 🦞 diamond lobster. Replaced prior rating: 🦪 silver shellfish.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: A useful Control UI boot-download improvement with bounded user impact and no demonstrated urgent runtime failure.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster. Replaced prior rating: 🦪 silver shellfish.
  • 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-19T08:17:42.731Z sha ddc4c17 :: needs changes before merge. :: [P2] Keep the shared agent-creation permission message available | [P2] Prevent delayed status formatting from republishing older state | [P2] Await failure hydration in the existing overlay suites | [P2] Register lazy English in the channel presentation contract test

Reviewed October 19, 2026, 4:55 AM ET / 08:55 UTC (Revision 2).

@steipete steipete changed the title perf(ui): defer cold command and update boot work perf(ui): recover chat and New Session boot headroom Oct 19, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

All four findings are addressed on 7f37e2d181b: the Agents detail route registers its English recovery copy; the existing Agents Home route already reaches the same registration through its static catalog dialog imports. Update status publication now rejects superseded formatter completions. The affected update tests await observable hydration, and the channel contract test reads the complete canonical source catalog. The repaired files passed 87 assertions; the additional ordering regression and its owner siblings passed 13 tests. Full UI CI is running on the replacement head.

The final paired production build saves 16,132 B for chat and 21,117 B for New Session, leaving 35,622 B and 26,282 B below the original caps. The PR body includes current measurements and inspected before/after screenshots.

@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the clawsweeper:intake:feature Preliminary submission classification; full source review pending. label Oct 19, 2026
@steipete
steipete merged commit 353db54 into main Oct 19, 2026
128 of 129 checks passed
@steipete
steipete deleted the solid2/w-perf-headroom branch October 19, 2026 09:10
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with prior CI and scoped validation.

steipete added a commit that referenced this pull request Oct 19, 2026
The Plus menu was deferred in #177117. A one-shot visibility check could skip the Skills click while its chunk loaded, then wait for a submenu that was never requested. Branch on the root view and let the existing click await its target. Keep all private-pin, read-only, and session-scope assertions unchanged.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 20, 2026
* perf(ui): defer cold command and update boot work

* fix(ui): preserve shared labels and await update projections

* perf(ui): defer composer menu content until first open

* style(ui): keep lazy menu imports type-only

* test(ui): assert menu admission through rendered trigger

* perf(ui): regenerate boot groups after menu deferral

* perf(ui): load session management English with its consumers

* fix(ui): preserve status response order across lazy formatting

* test(ui): await lazy composer menu content in consumers
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 20, 2026
The Plus menu was deferred in openclaw#177117. A one-shot visibility check could skip the Skills click while its chunk loaded, then wait for a submenu that was never requested. Branch on the root view and let the existing click await its target. Keep all private-pin, read-only, and session-scope assertions unchanged.
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. clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: XL 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