Repository navigation
perf(ui): recover chat and New Session boot headroom - #177117
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. |
There was a problem hiding this comment.
💡 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".
|
Codex review: needs maintainer review before merge. What this changesThis 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.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete 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 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe 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]
Technical reviewBest 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
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +558, Tests +316, Other +6. Total +880 across 68 files. Added test files: 1. 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 HistoryReview history (1 earlier review cycle)
Reviewed October 19, 2026, 4:55 AM ET / 08:55 UTC (Revision 2). |
|
@clawsweeper re-review All four findings are addressed on 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. |
|
🦞👀 Re-review progress:
|
|
Merged via explicitly authorized admin squash with prior CI and scoped validation.
|
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.
* 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
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.
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: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.
ci:full; replacement-head run passed on1c8bfa45ff3: 49 jobs succeeded, 23 skippedThe 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.