Skip to content

perf(ui): keep Devices out of chat boot - #174820

Merged
steipete merged 4 commits into
mainfrom
solid2/w-perf-chat-boot
Oct 17, 2026
Merged

steipete merged 4 commits into
mainfrom
solid2/w-perf-chat-boot

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Chat and New Session were preloading the Devices inventory and approval UI. The route already imports its page dynamically, but a co-located capture put that page and its dependencies into the shared boot group.

User Impact

Keep the existing Devices route lazy. Chat boot saves 24,060 B gzip of JavaScript and New Session saves 26,515 B, without increasing request counts. Both routes also avoid 4,691 B gzip of CSS. The Devices page and pairing dialog retain their separate loading boundaries.

Why This Change Was Made

Give the Devices page a stable chunk, using the existing Plugins/Cron pattern, and regenerate the canonical cold/warm boot capture. The refreshed capture drops the Devices views and locale from shared boot, moves genuinely route-specific helpers into their own route group, and picks up the current session-details owner name. No renderer or stylesheet contents change.

Extend the existing emitted-chunk regression to include a lazy Devices entry even when an old capture includes it in shared boot. This protects the loading boundary rather than a source-string pattern.

Evidence

Both builds use the same machine, installed toolchain, fixed timestamp/build ID, and strict checker. Merge base: 12311e42e4ada8e7044c4e3d2e50f7d63d359bd8.

Metric Base Head Change
Startup JS gzip 340,469 B 340,731 B +262 B
Startup JS requests 7 7 0
Startup CSS requests 1 1 0
Chat boot JS gzip 1,641,645 B 1,617,585 B -24,060 B
Chat boot JS requests 30 30 0
New Session JS gzip 1,331,139 B 1,304,624 B -26,515 B
New Session JS requests 27 27 0
Chat boot CSS gzip 131,348 B 126,657 B -4,691 B
New Session CSS gzip 108,697 B 104,006 B -4,691 B

The small startup increase comes from regrouped import references and stays below the existing 512 B growth allowance and 342,000 B ceiling. Strict base/head comparison: zero violations. No budget increase.

  • Base and head pnpm ui:build: pass.
  • pnpm ui:boot-manifest:gen: cold/warm synthetic /new and /chat captures pass.
  • pnpm tsgo:ui: pass.
  • Changed chunking test file: 6 pass, 1.83 s suite / 5.25 s wrapper.
  • Targeted lint/format and git diff --check: pass.
  • Independent Codex review: no actionable P0–P2 findings.
  • Production Knip (pnpm deadcode:knip): pass.
  • Full UI proof requested with ci:full. No renderer/style-content changes; screenshots are not applicable.
Scoped refactor count Before After
Controller patterns 0 0
createEffect / createRenderEffect 0 / 0 0 / 0
untrack 0 0
Native listeners / DOM queries 0 / 0 0 / 0
Manual class strings / flush 0 / 0 0 / 0
Owner capture 0 0
Production TypeScript LOC 276 278
Generated boot-manifest LOC 2,677 2,655
Test LOC 247 268

The two production lines reuse the chunk owner; generated production inputs shrink by 22 lines. No new state, abstraction, or dependency. Test growth extends the existing bundle fixture with one distinct stale-capture regression.

Inherited CI failure

Full CI run 38980816039 fails only the six chat-metadata-observation cases for sharing pending catalog reads: single, shared, late follower, late follower without metadata, late follower without metadata/metadata first, and late follower/catalog first. All six fail identically on scheduled main run 38981593815: models.list receives 3 requests instead of 2, while chat.metadata remains 2. The test and its four metadata/catalog owners have identical Git blobs in the tested merge, its main parent, and scheduled main. This is recorded for native inherited-failure admission; the failed CI is not claimed green.

Chat boot module and chunk audit

Chat boot breakdown

Measured from the production build at 12311e42e4ada, using the strict performance checker and shipped gzip sidecars. Startup is included in route totals. Source-map module figures are separately gzipped generated spans: ranking estimates, not additive shares of their containing chunks.

  • Chat: 1,641,645 B / 30 JS requests.
  • New session: 1,331,139 B / 27 JS requests.
  • Startup: 340,469 B / 7 JS requests; 1 CSS request.

Largest loaded chunks

Chunk Gzip bytes
assets/control-ui-boot-shared-B_WYkNAe.js 191,075
assets/control-ui-boot-shared-DTjA7Qm6.js 174,907
assets/control-ui-core-DBnK-ZpL.js 148,610
assets/control-ui-boot-chat-BGr5Fvgn.js 141,636
assets/control-ui-boot-chat-B4gStnxe.js 140,918
assets/control-ui-core-DtNYuJrN.js 105,307
assets/control-ui-boot-shared-BD6-l21z.js 84,944
assets/markdown-runtime-lrjtlJ4T.js 78,127
assets/ui-BOA8luxp.js 77,104
assets/control-ui-boot-shared-Xm5RTxC8.js 72,422
assets/control-ui-boot-shared-BkUTz1im.js 69,681
assets/control-ui-boot-shared-Dl2FWIh0.js 46,453
assets/control-ui-boot-chat-Dp2cpmbS.js 45,021
assets/control-ui-boot-chat-Dv31iQqK.js 43,210
assets/control-ui-boot-shared-CyWsF1rf.js 42,961

Largest source modules

Module Separate gzip estimate
ui/src/i18n/locales/en.ts 51,259 B
node_modules/.pnpm/[email protected]/node_modules/markdown-it-emoji/lib/data/full.mjs 16,122 B
node_modules/.pnpm/[email protected]/node_modules/markdown-it/dist/markdown-it.mjs 15,931 B
node_modules/.pnpm/[email protected]/node_modules/entities/dist/generated/decode-data-html.js 13,131 B
node_modules/.pnpm/[email protected]/node_modules/dompurify/dist/purify.es.mjs 11,172 B
node_modules/.pnpm/[email protected]/node_modules/highlight.js/lib/core.js 7,945 B
node_modules/.pnpm/[email protected]/node_modules/zod/v4/core/schemas.js 7,833 B
node_modules/.pnpm/@[email protected][email protected]/node_modules/@solidjs/web/dist/web.js 7,109 B
node_modules/.pnpm/@[email protected]/node_modules/@tanstack/virtual-core/dist/esm/index.js 6,640 B
ui/src/app/app-root.tsx 6,542 B
node_modules/.pnpm/@[email protected]/node_modules/@solidjs/signals/dist/prod/store/store.js 6,230 B
node_modules/.pnpm/[email protected]/node_modules/remend/dist/index.js 5,871 B
src/infra/update-run-report.ts 5,863 B
ui/src/pages/chat/chat-pane-render.ts 5,424 B
ui/src/i18n/locales/en-devices.ts 5,405 B
ui/src/pages/chat/components/chat-composer-view.tsx 5,220 B
node_modules/.pnpm/@[email protected]/node_modules/@zag-js/vanilla/dist/machine.mjs 5,059 B
ui/src/i18n/locales/en-plugin-management.ts 4,994 B
ui/src/pages/chat/components/chat-composer-queue.tsx 4,675 B
node_modules/.pnpm/@[email protected]/node_modules/@openclaw/uirouter/dist/index.js 4,608 B

First paint versus interaction

Area Boot status and requirement Next action
Transcript, composer, sidebar, Solid runtime Required for first transcript paint and composer focus; dominates the shared chunks. Preserve identity/focus; split only optional children.
Devices inventory and approvals Cold Devices route; only production renderer import is dynamic, yet the capture co-locates it in boot. Isolate the page entry and regenerate the capture. Keep pairing dialog separate.
Markdown and highlighting Markdown required for transcript; all 14 grammars currently eagerly register from markdown-code-blocks.ts. Defer grammar enhancement only with escaped first render, asynchronous owner updates, and visual proof.
Emoji Full dictionary loaded by composer completion and reaction picker; ~16 KB module estimate. Defer behind shortcode/picker intent while preserving first keystroke and undo semantics.
Mermaid ~897 KB standalone renderer, already absent from boot. Keep existing block-triggered loading.
PDF/media No PDF.js: PDF uses native iframe; image lightbox (~4 KB owner plus views) and audio controls still eager. Defer lightbox on open; preserve media-source custody and inline audio behavior.
Terminal ~183 KB Ghostty engine already lazy; no xterm package in boot. Keep engine boundary; only small terminal coordination is eager.
Board/canvas Board renderer dynamic; provider and lifecycle coordination eager. Keep retained-board ownership; inspect optional provider methods before splitting.
MCP apps Catalog/resource code eager. Inline catalog is intentionally visible for admitted sessions; event constant imports also reach its renderer. Separate resource event contract and defer expanded resource details; do not hide inline apps.
Diff/tool details ExpandedToolCardContent imported by collapsed cards; DiffStatChips shares module with DiffBlock. Split stats contract and lazily render expanded details.
Locales Non-English catalog chunks already deferred; core English ~51 KB plus eagerly registered domain catalogs. Separate cold English domains with synchronous registration at their consumers.
Schema/validation Zod ~28.6 KB plus TypeBox in boot; cache snapshot reader uses both. Consolidate only at cache trust boundary, without duplicate validation or weakened admission.
Icons ~12 KB separate module estimates, indexed by runtime names. Lower priority: preserving synchronous names needs an explicit API boundary.

Dependency duplication audit

The loaded sourcemaps show one installed version each of MarkdownIt, entities, highlight.js, Zod, TypeBox, and Solid. The highlight.js ESM entry wraps its one CommonJS core; it is not a second engine. Zod and TypeBox are separate validators with different current callers, not duplicate package versions. No dependency override is proposed.

Replacement-head CI attribution

After merging current main to resolve repeated GitHub mergeability timeouts, run 38986318322 passes all selected jobs except Real Gateway 2/2. Its sole failing test is Control UI cross-channel automation management with a real Gateway > configured owners and admin chat manage a Telegram-created job while a non-owner cannot: waiting for provider.results.has(marker) after an admin-chat send times out at line 496. The Devices alias rename/reload/restart case passes, as do 57 other tests in that shard. The failing test and entire QA, chat, Gateway, agents, and Cron owner trees are byte-identical to the actual CI main parent. The three-file Devices chunk change does not alter that automation-provider path. Native admin admission uses the explicitly authorized unrelated-failure exception; this is not claimed as an identical failure reproduced on scheduled main.

Latest integration proof

After resolving only the generated boot capture against current main, the exact integrated tree (384ea375264) passes the production build and strict performance check with zero violations. Startup: 340,855 B gzip / 7 JS requests / 1 CSS request. Chat: 1,600,166 B / 30 JS requests, CSS 126,338 B. New Session: 1,285,972 B / 27 JS requests, CSS 103,761 B. These totals include concurrent merged changes; the paired table above isolates this PR’s measured win. The native commit hooks passed for the merge tree and regenerated capture.

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

clawsweeper Bot commented Oct 16, 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.

@steipete
steipete marked this pull request as ready for review October 16, 2026 23:19
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 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-17T01:29:51.679355Z 384ea37 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.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug 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. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Give Devices a separate build chunk and refresh the measured Chat and New Session boot manifest.

Example: Cold-load Chat without opening Devices.

  • Before: Reported boot JavaScript is 1,641,645 B gzip, including Devices code.
  • After: Reported boot JavaScript is 1,617,585 B gzip, with the same 30 requests.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, apparently correct patch with useful bundler regression coverage; reported browser measurements support it, while direct runtime evidence and CI attribution remain limited.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its body reports production-build measurements and cold/warm bundled-browser captures, but supplies no inspectable runtime trace beyond those reported results.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Opening Chat or New Session downloads Devices inventory and approval UI that the user has not opened.
Reason: The maintainer-authored direction restores an existing lazy boundary with a small build-rule change and reported payload savings.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it restores an intended lazy-loading boundary with a focused change and no actionable code findings; the failed UI CI check remains unattributed.

Priority: P2
Reviewed head: c90bbce15271488a24ec434f6ddd86246eeadf93

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied evidence does not show a runtime trace of subsequent Devices navigation or a base-failing run of the extended regression.
Agent review details

How this fits together

The Control UI build consumes measured module membership and chunk rules to emit hashed assets and route-specific preloads; the router dynamically imports Devices when opened.

flowchart LR
  A[Measured boot manifest] --> C[Build chunk rules]
  B[Dynamic route imports] --> C
  C --> D[Chat and New Session assets]
  C --> E[Devices chunk]
  D --> F[Browser boot]
  E --> G[Devices navigation]
Loading

Technical review

Best possible solution:

Keep Devices under its existing dynamic route loader and prevent measured boot grouping from eagerly including its page.

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

Source shows Devices in the base shared boot capture despite its dynamic route loader, with no stable chunk protecting that boundary; no target code was executed during this review.

Is this the best way to solve the issue?

The change uses the existing stable-chunk owner and regenerated capture, matching the Plugins/Cron pattern without adding another loading mechanism or relaxing budgets.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Measured boot membership and route preloads keeps the original intent (perf(ui): preload the chat route's boot chunks on cold loads #160293: Preload only the requested route's measured boot graph while keeping genuinely optional features lazy and preserving stylesheet insertion order.)
  • Stable lazy-page chunk ownership keeps the original intent (7c06f39: The Solid shell migration retained lazy route ownership and introduced explicit Plugins/Cron page chunks.)
  • Emitted-chunk regression coverage keeps the original intent (perf(ui): keep JSON5 out of chat boot #174728: Verify optional loading boundaries through emitted static and dynamic imports rather than retired source fixtures.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source -20, Tests +21. Total +1 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 12 32 -20
Tests 1 25 4 +21
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 37 36 +1

Labels

Label changes:

  • add P2: A focused boot-payload improvement with limited blast radius and no demonstrated urgent user regression.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp 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:

  • P2: A focused boot-payload improvement with limited blast radius and no demonstrated urgent user regression.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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 October 16, 2026, 7:35 PM ET / 23:35 UTC.

@steipete
steipete enabled auto-merge (squash) October 17, 2026 01:37
@steipete
steipete merged commit 51ea9e5 into main Oct 17, 2026
92 of 94 checks passed
@steipete
steipete deleted the solid2/w-perf-chat-boot branch October 17, 2026 01:42
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
* perf(ui): keep Devices out of chat boot

* build(ui): refresh lazy Devices boot capture after integration
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. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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