Skip to content

perf(ui): defer voice selection to call startup - #186131

Merged
steipete merged 4 commits into
mainfrom
solid2/w-boot-voice-setup-next
Oct 27, 2026
Merged

steipete merged 4 commits into
mainfrom
solid2/w-boot-voice-setup-next

Conversation

@steipete

@steipete steipete commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Cold Chat boot imports realtime voice selection even when no call exists. Move its construction into the existing call-start runtime; no new import or network round trip is added to boot or call startup. Synchronous gesture-bound audio preparation stays in the plain owner. The prepared playback object identifies a pending attempt, preserving stop, disconnect, route replacement, supersession, live voice replacement, microphone choice, and transcript order.

This is a small byte reduction, not a CPU-speed claim or completion of W-BOOT-DIET. The earlier checkpoint is #186004. The target remains roughly 950 KB less unused-at-boot raw JS; this step's current Chat boot raw-byte saving is only 2,705 B. Larger optional-owner and catalog cuts remain separate work.

Evidence

Current-head size proof

Fresh same-machine production builds compare base c28d2e4294e478ab3d50ba6a776b9c1892d71de7 with current head 13b4ce02091699fea0d37bc08a2624e459f6e652.

Surface Base raw / gzip B Head raw / gzip B Requests
Startup 280,362 / 90,000 280,362 / 89,995 3 JS + 1 CSS, unchanged
Chat 4,009,078 / 1,251,821 4,006,373 / 1,251,339 19 JS + 3 CSS, unchanged
New Session 2,477,120 / 767,519 2,477,120 / 767,476 15 JS + 3 CSS, unchanged

Both strict checks pass with zero violations. Chat saves 2,705 raw / 482 gzip B. Startup/New Session raw bytes and requests are unchanged; their -5/-43 B gzip movement is within 64 B build variance. CSS bytes are unchanged on every surface. No budget was changed. Both sides have identical native-UI inputs for memory-core, nostr, and whatsapp (13 manifest/package/asset files), and all 21 emitted plugin asset/revision entries match by path, size and SHA-256. This checks the injected distribution inventory directly rather than relying on source maps.

Current scoped LOC: production 674→690; tests 1,197→1,200; generated boot manifest 1,856→1,855; total 3,727→3,745 (+18).

Historical coverage and timing cohort

The following coverage, HTTP, timing, compiler, screenshot and ranking evidence compares frozen base bc197791931b3e98dd09a19c68ae3077478c5e2a with runtime head abb4524e0eb76287eed6e5249d08aaf8da2d916a. It predates the main integration and is retained as historical evidence of the same voice-runtime cut. It is not a new measurement of the current head 13b4ce0.

V8 cold capture Loaded raw B Executed raw B Unused raw B
Local base 4,158,150 1,937,478 2,220,672
Local head 4,155,463 1,939,096 2,216,367
100 ms RTT base 4,158,150 1,936,760 2,221,390
100 ms RTT head 4,155,463 1,936,945 2,218,518

Completed HTTP JavaScript resources are 4,564,953 → 4,562,266 raw B; 62 requests on both sides. V8 records evaluated scripts, so its loaded count is distinct from completed downloads. Unused decreases 4,305 B locally and 2,872 B at RTT; executed-range variation is not claimed as an execution saving. Source-map analysis finds zero duplicate source identities across loaded chunks.

Historical timing and compiler proof

Acceptance was written before measurement: at least 20 serial base/base/head triplets per localhost and 100 ms RTT / 10 Mbps profile; retain A/A, host load and every sample. Initial tails were mixed, so the authorized extension added 20 triplets per profile. The combined result below contains all 40 triplets per profile, with nearest-rank p95. Coverage and traced diagnostics are separate from timing. The same frozen canonical harness ran both bundles. Opening and closing censuses matched all 5,982 files per bundle, 5,275 harness outputs, 27,032 dependency files, and Chromium.

Profile / metric Base median / p95 ms Head median / p95 ms Change median / p95
local / Script CPU 499.929 / 564.784 507.493 / 537.092 +1.51% / -4.90%
local / Task CPU 995.822 / 1174.308 1004.893 / 1119.041 +0.91% / -4.71%
local / Nonempty transcript 371.900 / 438.400 374.650 / 414.600 +0.74% / -5.43%
local / Enabled composer 172.500 / 180.600 174.250 / 183.200 +1.01% / +1.44%
local / Longest task 59.000 / 81.000 59.000 / 66.000 +0.00% / -18.52%
rtt / Script CPU 611.011 / 660.323 619.184 / 662.025 +1.34% / +0.26%
rtt / Task CPU 1233.188 / 1392.397 1255.077 / 1362.164 +1.77% / -2.17%
rtt / Nonempty transcript 1390.150 / 1402.000 1391.150 / 1410.700 +0.07% / +0.62%
rtt / Enabled composer 1390.150 / 1402.000 1391.150 / 1410.700 +0.07% / +0.62%
rtt / Longest task 94.000 / 104.000 96.000 / 108.000 +2.13% / +3.85%

A/A script median/p95: local −0.11%/−4.77%, RTT +0.68%/−1.36%. A/A task: local +0.04%/−7.77%, RTT +1.00%/−2.35%. Host one-minute load ranges: 10.33–23.16 local, 11.08–18.69 RTT. Main-thread CPU and transcript readiness hold under the campaign's noisy-host rule; this is not an all-cells improvement. Disclosed upward cells: local enabled-composer p95 +2.6 ms (+1.44%), RTT layout p95 +3.173 ms (+10.46%), and RTT longest-task p95 +4 ms (+3.85%). The changed call-start function is never executed in these cold captures; boot adds one null field and removes definitions, with no new DOM/layout/scheduling path.

Eight separate traced cold loads (two per role/profile) supply coarse compiler diagnostics, not stable latency estimates:

Coarse compilation CPU mean Base ms Head ms
Local main thread 4.359 4.301
Local all renderer threads 65.818 65.430
RTT main thread 4.397 4.402
RTT all renderer threads 63.392 66.801

These are nested-interval-unioned native V8 parse/compile/deserialization spans, not exhaustive compiler CPU. RTT all-renderer mean is +3.409 ms (+5.38%) in only two samples; no compiler-speed win is claimed. Navigation-reset negative CDP deltas were retained and excluded from conclusions. The harness rejected an initial traced-comparison command before any workload; supported single-bundle invocations replaced it without changing the harness. An older harness was also rejected by its opening dependency census before measurement.

Reproduction: pnpm ui:build on each side, followed by node --import ./scripts/tsx.mjs scripts/check-control-ui-performance.mts --json; the head check also supplies --base-dist <base-dist>. The checker is strict by default. Use the committed scripts/bench-control-ui-cold-load.ts workload with --gateway-http --first-load --cold-http-cache --face chat --boot-route chat --viewport desktop --fixture-now-ms 1800000000000 --capture-ms 0 --thread-cpu-time. For untraced timing add --untraced --runs 60 --bundle-dir <base-dist> --compare-bundle-dir <base-dist> --compare-bundle-dir <head-dist>; run twice per profile. Local adds --network-latency-ms 0 --download-kbps 0; RTT adds --network-latency-ms 100 --download-kbps 10000. Coverage uses two runs/base-head and --coverage; traced diagnostics use separate single-bundle --runs 1 calls in base/head/base/head order.

Checks and scope

Current-head CI 40560694725, attempt1, completed. Both Real-Gateway shards passed; the sole failed test job is UI E2E6/7 with four inherits composer and bubble surfaces in … without changing geometry cases (claw/absolutely, light/dark). All four expect78% translucent colors but receive opaque RGB at theme-surfaces.e2e.test.ts:194. They fail with identical names and values in completed UI E2E3/7 job 122388096098 of the scheduled main run at this PR’s exact base c28d2e4. The full main run was still running unrelated jobs when inspected. The test and relevant CSS/theme blobs match the actual PR tested merge and main base. This follows the opaque-surface change in #183295, outside this PR. No other PR job failed or was cancelled. Native inherited-failure recovery retains this evidence; CI is not called green. The cached-chat fixture is byte-identical to the previously reviewed/tested version, including zero-subscription assertions before hello.

Previous-head CI run 40555286500, attempt 1, completed. Both Real-Gateway shards passed. The only failing test job is UI E2E shard 4: keeps new batches in Details and opens Subagents manually without duplicate wait status times out at chat-header-subagents.e2e.test.ts:211, and reconciles an explicit suggestion refresh after an event while chat remains held (hidden: true) fails expected 1 to be +0 at chat-startup-priority.e2e.test.ts:235. Both exact names and signatures also fail in latest completed scheduled main run 40550646318, shards 5 and 1 respectively. Both test files and relevant owners have identical Git blobs in the actual tested merge and its main parent. All other CI jobs passed or skipped; no jobs were cancelled. The native inherited-failure route retains these failures rather than declaring CI green.

Measured integration a809a01 passes pnpm tsgo:ui and all three chat-cold-load-anchor.e2e.test.ts cases. The fixture now releases hello before expecting subscription traffic and explicitly verifies zero subscribe/unsubscribe traffic before hello. The prior PR-body check failed because its expected problem/evidence headings were absent; those headings have been corrected.

UI typecheck passed. The two coupled realtime suites passed all 49 tests before the test-only consolidation; the changed realtime suite then passed all 42 tests once after consolidation, with the pinned Bun runner and one worker. Scoped lint/format passed. Historical broad export Knip reported the same scheduleLine, runPrompt, and SessionColdOversized diagnostics on its base and head; no ignores were added. Measured-head canonical production Knip (pnpm deadcode:knip) passed with exit 0 in 52.0 seconds and no findings; no ignores were added. Independent P0–P2 runtime review is clean; the test-only follow-up preserves the original camera-switch mock after independent review, and its final P0–P2 review is clean. ci:full covers the remaining UI and real-Gateway suites.

The current LOC growth shown above preserves explicit pending-attempt ownership while moving construction; it adds no abstraction, dependency, option, tag, route, or selector. All owners remain plain TypeScript.

Historical synthetic visual proof

The inspected cold Chat captures contain synthetic fixture data only and show the same transcript, composer, and sidebar. Voice is unopened during this workload.

Before: synthetic cold Chat
After: synthetic cold Chat

Historical top 30 unused-at-boot modules and functions

Generated UTF-8 byte attribution; module and exclusive-function tables overlap. Notes classify call paths, not measured frequency.

Base bc197791; head abb4524e; both use the same fresh canonical abb4524e harness. Local and 100 ms RTT coverage diagnostics are separate from timing.
Cells show rank / unused raw bytes. A dash means outside that cell’s top 30. New source hashes are never silently assigned old notes.

Modules

Source / function Local base Local head RTT base RTT head Follow-up
markdown-it/dist/markdown-it.mjs 1 / 32,726 1 / 32,726 1 / 32,726 1 / 32,726 Common: Common rendered-message work, with content-dependent grammar. Keep the ordinary Markdown path available; do not classify the whole parser as rare. Unused branches include block/inline HTML forms, references, escapes, nested lists and tables that depend on message syntax. ui/src/components/markdown-parser.ts:135
dompurify/dist/purify.es.mjs 2 / 12,386 2 / 12,386 2 / 12,386 2 / 12,386 Common: Common security boundary for rendered Markdown and JSON markup. Element/attribute removal is payload-dependent; alternative DOM-return/import modes are library capabilities, not requested by this string-rendering caller. ui/src/components/markdown.ts:159
@tanstack/virtual-core/dist/esm/index.js 3 / 11,658 3 / 11,658 3 / 11,658 3 / 11,658 Common: Common transcript viewport work on scrolling, row changes and resize. Keep single-column measurement, range and offset work available; horizontal/multi-lane modes and platform/smooth-scroll adjustments are conditional library branches. ui/src/pages/chat/components/chat-transcript-virtualizer-host.ts:206
lib/protocol-validators.generated/approvals.js 4 / 10,221 4 / 10,221 4 / 10,221 4 / 10,221 Common: Common automatic approval-replay validation during chat subscription, including an empty replay. Nonempty approval variants and later approval-event outcomes are conditional on actual approval work; this is not a wholly optional module. ui/src/pages/chat/session-approval-projection.ts:92
pages/chat/chat-pane-side-panels.ts 5 / 9,569 5 / 9,569 5 / 9,569 5 / 9,569 Common: Opening conversation/context/session rails and mobile navigation; companion-question and attachment paths require that optional feature. ui/src/pages/chat/chat-pane-header.ts:568
linkify-it/build/index.mjs 6 / 8,970 6 / 8,970 6 / 8,970 6 / 8,970 Common: Common auto-linking capability on rendered messages, conditional on URL-like text. Detailed schemes, punctuation termination and fuzzy-address branches depend on content; disabled fuzzy-link forms must not be counted as an expected next interaction. ui/src/components/markdown-parser.ts:138
pages/chat/chat-pane-sharing.ts 7 / 8,849 7 / 8,849 7 / 8,849 7 / 8,849 Common: Common typing updates while composing a shared session; sharing/suggestion acceptance, multiple identities and remote actor states are conditional. ui/src/pages/chat/chat-pane-render.ts:523
app/app-shell-chrome.ts 8 / 8,749 8 / 8,749 8 / 8,749 8 / 8,749 Common: Common keyboard/navigation/resize and palette interactions; approvals, debug overlays, focus recovery and lazy-shell retries are conditional. ui/src/app/app-shell-chrome.ts:124
ipaddr.js/lib/ipaddr.js 9 / 8,647 9 / 8,647 9 / 8,647 9 / 8,647 Conditional/common: Conditional/common URL-host validation for preview/reader media. IPv4/IPv6, embedded-address and invalid/legacy forms are input-dependent security branches, not an ordinary plain-text-only cost. packages/net-policy/src/ip.ts:118
pages/chat/components/chat-composer-view.tsx 10 / 8,529 10 / 8,529 10 / 8,529 10 / 8,529 Common: Common typing/submitting, picker and attachment controls; disabled banners, pending queue/questions, goals and voice state are conditional. ui/src/pages/chat/components/chat-composer-view.tsx:65
app/app-root.tsx 11 / 8,506 11 / 8,506 11 / 8,506 11 / 8,506 Common: Common shell connection/navigation updates; login, focused-window routes, errors, and optional shell surfaces are conditional. ui/src/app/app-root.tsx:97
components/select-picker-view.tsx 12 / 8,234 12 / 8,234 12 / 8,234 12 / 8,234 Common: Opening a picker, searching/filtering, keyboard selection, group expansion and scrolling; variants require different branches. ui/src/components/select-picker.ts:22
pages/chat/chat-pane-session-menu.ts 13 / 8,225 13 / 8,225 13 / 8,225 13 / 8,225 Common: Session header shortcuts and menu/group actions; archive, mutations, confirmation and stale-owner/error handling are conditional. ui/src/pages/chat/chat-pane-session-menu.ts:120
@solidjs/signals/dist/prod/store/store.js 14 / 8,043 14 / 7,903 14 / 8,043 14 / 8,043 Common: Common reactive store infrastructure. Record reads/writes and snapshot publication are ordinary UI work; array reconciliation, nested adoption, clone/overlay and descriptor paths require their corresponding state shapes or mutations. Do not treat the entire store as deferrable. ui/src/components/select-picker-view.tsx:86
lib/protocol-validators.generated/activity.js 15 / 7,822 15 / 7,822 15 / 7,822 15 / 7,822 Conditional/common: Conditional/common live-run and sidebar updates. Activity validation supports normal streamed tools/narration, but the payload unions, optional delegation fields, observer details and reaction identities are triggered by particular events. ui/src/pages/chat/tool-stream.ts:497
components/session-organizer.ts 16 / 7,807 16 / 7,807 16 / 7,807 16 / 7,807 Common: Sidebar pin/archive/group and drag/drop organization; rollback and mutation failures are conditional. ui/src/components/session-organizer.ts:54
api/gateway.ts 17 / 7,673 20 / 7,568 17 / 7,673 17 / 7,673 Common: Common RPC/event traffic and connection lifecycle; native-auth, pairing, scope upgrades, heartbeat retry and error paths are conditional. ui/src/app/gateway-store.ts:621
pages/chat/chat-outbox-owner.ts 18 / 7,661 17 / 7,661 18 / 7,661 18 / 7,661 Common: Fresh/queued sends, draft persistence and projection updates; stored-queue recovery, admission failures and cleanup require their respective state. ui/src/pages/chat/chat-outbox-owner.ts:66
pages/chat/chat-view.tsx 19 / 7,632 18 / 7,632 19 / 7,632 19 / 7,632 Common: Common transcript/composer updates, search and active run presentation; task suggestions, approvals and notices depend on session state. ui/src/pages/chat/chat-view.tsx:59
pages/chat/chat-pane-lifecycle.ts 20 / 7,578 19 / 7,577 20 / 7,578 20 / 7,577 Common: Pane activation/visibility/session changes and disposal; live transcript reads pause and resume with presentation, other subscriptions/errors are conditional. ui/src/pages/chat/chat-pane-lifecycle.ts:301
lib/sessions/github-publication-owner.ts 21 / 7,558 21 / 7,558 21 / 7,558 21 / 7,558 Common: Visible publication-enabled panes automatically discover options and recover pending status; account selection, publishing, confirmation and retry are conditional user actions. ui/src/pages/chat/chat-pane-publication.ts:12
components/solid/menu.tsx 22 / 7,537 22 / 7,537 22 / 7,537 22 / 7,537 Common: Initial closed-body rendering for non-lazy menus, plus menu updates, opening and navigation. Nested groups, custom rows, disabled choices and input controls select additional branches; explicitly lazy menus defer their bodies until opened. ui/src/components/solid/menu.tsx:430
pages/chat/chat-send-submit.ts 23 / 7,497 23 / 7,497 23 / 7,497 23 / 7,497 Common: First and later send/submit actions; slash commands, goals, queued edits, attachments and offline admission select optional branches. ui/src/pages/chat/chat-state-page.ts:356
components/session-progress-card-solid.tsx 24 / 7,417 24 / 7,417 24 / 7,417 24 / 7,417 Conditional/common: Rendering a session progress card; board, details and composer placements plus menu/disclosure states select separate branches. ui/src/pages/chat/components/chat-composer-regions.tsx:73
pages/chat/chat-pane-history.ts 25 / 7,385 25 / 7,386 25 / 7,385 25 / 7,386 Common: Older-history scrolling, visibility resume, rewind/fork/branch actions; cancellation and staged prefetch depend on navigation. ui/src/pages/chat/chat-pane-history.ts:110
packages/gateway-client/src/session-projection.ts 26 / 7,062 26 / 7,062 26 / 7,062 26 / 7,062 Common: New send, persisted-message, run-delta and run-terminal updates; transport gaps/reconnect/reset are conditional branches. ui/src/pages/chat/history-merge.ts:182
entities/dist/decode.js 27 / 7,053 27 / 7,053 27 / 7,053 27 / 7,053 Conditional/common: Conditional/common Markdown entity decoding. Named/numeric references and malformed or split sequences depend on text. HTML-attribute, legacy and XML decode modes are separate exported library modes, not established by the reviewed strict Markdown caller. node_modules/.pnpm/[email protected]/node_modules/markdown-it/dist/markdown-it.mjs:4
pages/chat/chat-pane-board.ts 28 / 7,019 28 / 7,019 28 / 7,019 28 / 7,019 Common: Optional board/dashboard and side-panel navigation, layout resize; saving dashboard defaults and swarm-specific presentation are less common feature paths. ui/src/pages/chat/chat-pane-board.ts:650
@solidjs/web/dist/web.js 29 / 7,000 — / 6,728 29 / 7,000 29 / 7,000 Common: Common DOM rendering and event/property updates. Insert/spread/reconciliation are core UI work; portals require overlay content and hydration is a separate mode not selected by the reviewed app-root render entry point. ui/src/app/app-root.tsx:91
pages/chat/composer-dictation.ts 30 / 6,995 29 / 6,995 30 / 6,995 30 / 6,995 Rare/opt-in: Opt-in press-and-hold or direct voice dictation and its media permission/cancel/error lifecycle. ui/src/pages/chat/composer-dictation.ts:113
pages/chat/run-lifecycle.ts — / 6,951 30 / 6,951 — / 6,951 — / 6,951 Common: Normal run-state admission, live/terminal reconciliation, busy status and stop controls; abort replay, detached runs and stale-local terminal recovery depend on the current run and connection state. ui/src/pages/chat/chat-pane-context.ts:391

Functions

Source / function Local base Local head RTT base RTT head Follow-up
handleSendChat — pages/chat/chat-send-submit.ts 1 / 7,415 1 / 7,415 1 / 7,415 1 / 7,415 Common: Submitting a chat message, including normal first send; commands/goals/attachments/offline branches are conditional. ui/src/pages/chat/chat-state-page.ts:356
t — lib/protocol-validators.generated/board.js 2 / 5,458 2 / 5,458 2 / 5,458 2 / 5,458 Conditional/common: Cached or session Board snapshot restoration validates the saved Board payload before adopting widgets. ui/src/lib/board/gateway-provider.ts:152
— 3 / 4,946 3 / 4,946 3 / 4,946 3 / 4,946 Unresolved: Generated span without source ownership; no common/rare claim.
canApplySessionListSnapshot — lib/sessions/session-list-query.ts 4 / 4,039 4 / 4,039 4 / 4,039 4 / 4,039 Common: Automatic roster reconciliation after session-change events, including normal send/run changes; not a user-only menu action. ui/src/lib/sessions/session-roster-refresh.ts:656
buildChatItems — pages/chat/chat-thread-build.ts 5 / 3,780 5 / 3,780 5 / 3,780 5 / 3,780 Common: New replies, streaming/tool rows, search and refreshed history rebuild the transcript presentation; complex content selects unexecuted branches. ui/src/pages/chat/chat-thread.ts:433
drainStoredChatOutbox — pages/chat/chat-outbox-drain.ts 6 / 3,657 6 / 3,657 6 / 3,657 6 / 3,657 Common: Fresh queued sends and automatic retry/replay of stored entries; empty-queue cold boot exercises neither. ui/src/pages/chat/chat-outbox-drain.ts:68
loadChatRoute — pages/chat/route-loader.ts 7 / 3,652 7 / 3,652 7 / 3,652 7 / 3,652 Common: Navigation between sessions or faces and route revalidation; shared/slug/offline/not-found branches are conditional. ui/src/pages/chat/route-loader.ts:253
normalizeStoredQueueItem — lib/chat/outbox-store-codec.ts 8 / 3,485 8 / 3,485 8 / 3,485 8 / 3,485 Common: Serializing a fresh queued submission and reading restored queue entries; field variants depend on attachments/commands. ui/src/lib/chat/outbox-store-codec.ts:112
handleHeaderSessionAction — pages/chat/chat-pane-session-menu.ts 9 / 3,460 9 / 3,460 9 / 3,460 9 / 3,460 Conditional/common: Session-header menu/shortcut actions (copy, split, pin, rename, archive); group dialogs, plugin actions and failures require their respective action. ui/src/pages/chat/chat-pane-session-menu.ts:120
renderEntries — components/solid/menu.tsx 10 / 3,358 10 / 3,358 10 / 3,358 10 / 3,358 Common: Initial closed-body rendering for non-lazy menus, plus menu updates, opening and navigation. Nested groups, custom rows, disabled choices and input controls select additional branches; explicitly lazy menus defer their bodies until opened. ui/src/components/solid/menu.tsx:430
startRealtimeTalk — pages/chat/chat-realtime.ts 11 / 3,287 21 / 2,959 11 / 3,287 21 / 2,959 Rare/opt-in: Explicit realtime voice start and voice-change restart; requires voice capability and a connected client. ui/src/pages/chat/chat-realtime.ts:205
createModalPolicy — components/modal-dialog.tsx 12 / 3,267 11 / 3,267 12 / 3,267 11 / 3,267 Conditional/common: Mounting a modal and later focus/keyboard/close lifecycle; repeated open/close and nesting require interaction. ui/src/components/modal-dialog.tsx:136
WorkingStatus — pages/chat/components/chat-working-indicator.tsx 13 / 3,260 12 / 3,260 13 / 3,260 12 / 3,260 Conditional/common: Run working status; approval, retry, tokens and subagent handoff links vary with run state. ui/src/pages/chat/components/chat-working-indicator.tsx:198
openWorkspaceItem — pages/chat/components/chat-session-workspace-preview.ts 14 / 3,153 13 / 3,153 14 / 3,153 13 / 3,153 Conditional/common: Opening a file/workspace preview; pin/reuse and async loading paths depend on that optional interaction. ui/src/pages/chat/components/chat-session-workspace.ts:93
coalesceTurn — pages/chat/chat-tool-activity-coalesce.ts 15 / 3,143 14 / 3,143 15 / 3,143 14 / 3,143 Conditional/common: Rendering structured tool call/result activity after a send or history load; marker-free/plain turns return without the coalescing branches. ui/src/pages/chat/chat-tool-activity-coalesce.ts:218
PluginViewContent — plugins/control-ui-view.solid.tsx 16 / 3,141 15 / 3,141 16 / 3,141 15 / 3,141 Rare/opt-in: A configured plugin view is rendered; plugin mount/update/error paths are absent from an ordinary chat. ui/src/plugins/control-ui-view.solid.tsx:61
PersonReferenceContent — components/solid/person-reference.tsx 17 / 3,125 16 / 3,124 17 / 3,125 16 / 3,124 Conditional/common: Markdown person references render this content; opening a reference card invokes its separate idle-imported runtime. ui/src/components/solid/person-reference.tsx:25
resolveTaskSuggestion — pages/chat/chat-pane-task-suggestions.ts 18 / 3,082 17 / 3,082 18 / 3,082 17 / 3,082 Rare/opt-in: Accepting or dismissing a task suggestion; includes authorization, stale selection and start-failure branches. ui/src/pages/chat/chat-pane-task-suggestions.ts:312
createScanner — jsonc-parser/lib/esm/impl/scanner.js 19 / 2,991 18 / 2,991 19 / 2,991 18 / 2,991 Conditional/common: JSON-shaped message, code-block, draft and eligible tool-output formatting. Strings/numbers, escapes, comments and malformed tokens select different scanner branches. ui/src/components/markdown-json.ts:32
ChatPermissionCard — pages/chat/components/chat-permission-card.tsx 20 / 2,974 19 / 2,974 20 / 2,974 19 / 2,974 Rare/opt-in: A tool response requests a missing permission and the user chooses retry or settings. ui/src/pages/chat/components/chat-message-bubble-tools.tsx:257
tokenizeHtmlFlow — micromark-core-commonmark/lib/html-flow.js 21 / 2,963 20 / 2,963 21 / 2,963 20 / 2,963 Rare/opt-in: Conditional/library capability: Retained CommonMark HTML-block grammar is disabled in the reviewed Markdown code-ownership paths. Ordinary execution of those parsers does not establish execution of this HTML tokenizer. packages/markdown-core/src/markdown-code-regions.ts:12
readChatAttachmentFile — pages/chat/components/chat-attachment-reads.ts 22 / 2,774 22 / 2,774 22 / 2,774 22 / 2,774 Conditional/common: Adding/pasting a local file starts FileReader and upload preparation; compression consent, progress, abort, timeout and error branches require those outcomes. ui/src/pages/chat/components/chat-attachments.ts:139
handleTranscriptContextMenu — pages/chat/components/chat-thread-interactions.ts 23 / 2,760 23 / 2,760 23 / 2,760 23 / 2,760 Conditional/common: Right-click/context menu on a transcript row to reply/copy or act on tools and runs. ui/src/pages/chat/components/chat-thread-view.tsx:285
hydrateChatHistory — pages/chat/chat-history-hydration.ts 24 / 2,737 24 / 2,737 24 / 2,737 24 / 2,737 Common: Load/reload/switch/reconnect history; shared subscription admission, abort, stale and retry handling depend on read lifecycle. ui/src/pages/chat/chat-history-hydration.ts:74
RunFrame — pages/chat/components/chat-agent-run-frame.tsx 25 / 2,651 25 / 2,651 25 / 2,651 25 / 2,651 Conditional/common: Agent-run rows render the common frame around message/work/activity parts. Active-status-only frames take the StreamGroup path; ordinary RunFrame rendering derives grouped body, reply and source previews. It is selected by the frame row kind, not every transcript row. ui/src/pages/chat/components/chat-agent-run-frame.tsx:257
<anonymous/module> — pages/chat/components/chat-comment-pins.tsx 26 / 2,632 26 / 2,632 26 / 2,632 26 / 2,632 Rare/opt-in: Screenshot/comment annotation pins with attachment/comment data; hit-testing and drag/focus paths require that surface. ui/src/pages/chat/components/chat-thread-view.tsx:319
visit — jsonc-parser/lib/esm/impl/parser.js 27 / 2,613 27 / 2,613 27 / 2,613 27 / 2,613 Conditional/common: JSON tree construction after shape/size/token gates. Object/array traversal is ordinary for admitted JSON; error recovery, comments, trailing commas and alternate visitor callbacks are content/API-dependent. ui/src/components/markdown-json.ts:32
reconcileChangedEvent — lib/sessions/session-reconciliation.ts 28 / 2,609 28 / 2,609 28 / 2,609 28 / 2,609 Common: Automatic sessions.changed events after sends, completion, edits or archive updates; stale and absent-row branches depend on payload. ui/src/lib/sessions/index.ts:572
switchChatModel — pages/chat/chat-session.ts 29 / 2,548 29 / 2,548 29 / 2,548 29 / 2,548 Conditional/common: Selecting another model/account/runtime in the chat model controls. ui/src/pages/chat/chat-pane-session-controls.ts:264
consumeChatOutboxRecovery — lib/chat/outbox-recovery.ts 30 / 2,522 30 / 2,522 30 / 2,522 30 / 2,522 Rare/opt-in: Conditional recovery: Restore/discard of interrupted stored drafts or queued sends, and automatic retirement once their exact delivered messages are observed. Boot can consume matching stored recovery entries; boot without stored recovery entries cannot. ui/src/lib/chat/outbox-recovery.ts:246

Unmapped aggregate

Cell Loaded raw B Executed raw B Unused raw B
local-base 368,696 341,434 27,262
local-head 368,570 341,401 27,169
rtt-base 368,696 341,434 27,262
rtt-head 368,570 341,308 27,262

Unmapped bytes remain in totals. Execution coverage is not full compilation coverage or a completed-network ledger.

Correction to compile diagnostic profile: the four traced RTT diagnostic loads used 100 ms latency with unthrottled bandwidth (--download-kbps 0), while the 40-triplet untraced RTT timing cohort and RTT coverage captures used --download-kbps 10000. Their coarse V8 compiler measurements therefore describe a separate diagnostic profile, not the exact timing profile. Local diagnostics match local network settings. The timing/coverage results, all measured values, and original commands remain unchanged. This PR makes no compiler-speed improvement claim.

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

clawsweeper Bot commented Oct 27, 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 27, 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-27T18:32:50.126374Z 13b4ce0 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.

@steipete
steipete enabled auto-merge (squash) October 27, 2026 16:54
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 Oct 27, 2026
@clawsweeper

clawsweeper Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR defers voice-selection construction until Talk startup while preserving synchronous audio preparation and pending-call cancellation.

Example: Open Chat without starting a Talk call.

  • Before: The reported Chat bundle loads 4,077,093 raw JavaScript bytes, including voice-selection code.
  • After: The reported bundle loads 4,074,406 raw bytes, saving 2,687 bytes with unchanged request counts.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-consistent optimization with measured browser evidence and preserved lifecycle coverage; CI failure attribution remains incomplete.
Proof confidence 🐚 platinum hermit (4/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its built-UI cold-load measurements and inspected screenshots support the loading reduction, while the relocated call constructor has no supplied live-call capture.
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 voice-selection code before the user starts a call.
Reason: The maintainer-authored change delivers a measured, modest byte reduction through an existing loading boundary and preserves the established voice-settings and gesture-audio contracts.

Merge readiness

✅ Ready for maintainer review

Keep open: this is a useful maintainer-authored boot reduction with no concrete introduced defect found; exact-head CI remains failed, with two browser failures still unattributed.

Priority: P3
Reviewed head: 89f654f5921f20765205d4cf616232cb0c1e7b79

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied cold-load captures leave Talk unopened; live call startup and replacement are supported by source inspection and mocked lifecycle tests rather than a supplied live-call capture.
Agent review details

How this fits together

The Control UI realtime owner receives user actions and Gateway events, prepares browser audio, and loads the optional runtime that starts Talk sessions and manages voice replacement.

flowchart TD
  A[Chat user action] --> B[Synchronous realtime owner]
  B --> C[Prepared audio playback]
  B --> D[Lazy Talk runtime]
  D --> E[Voice selection owner]
  D --> F[Talk session]
  E --> F
  F --> G[Gateway and media transport]
Loading

Technical review

Best possible solution:

Land the focused deferral after the failed CI gate is resolved or its remaining failures receive supported attribution.

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

Current-main source establishes the eager voice-selection dependency, and the supplied browser measurements quantify its removal; this review did not independently run the workload.

Is this the best way to solve the issue?

Moving construction into the existing lazy runtime is a focused solution, and playback identity supplies the pending-attempt ownership that the deferred controller can no longer provide.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Lazy Talk startup and synchronous gesture preparation keeps the original intent (946f773: Defer optional voice continuation and camera code while retaining the plain owner's synchronous admission, cancellation, and audio preparation.)
  • Voice preference ownership keeps the original intent (2324085: Keep saved voice preferences in Settings and retain assistant-requested active-call voice changes.)
  • Synchronous realtime state ownership keeps the original intent (c7640b5: Keep call and device authority in one plain TypeScript owner while Solid observes state projections.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +17, Tests 0. Total +17 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 51 34 +17
Tests 1 28 28 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 79 62 +17

Review metrics

Metric Value Why it matters
Production versus test growth Production net +16 lines; tests net 0 lines The additional production state records pending playback ownership before the deferred voice controller exists; no new manager, dependency, or configuration option is introduced.

Labels

Label changes:

  • add P3: This is a small optional-code loading improvement with no demonstrated urgent user-facing failure.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 small optional-code loading improvement with no demonstrated urgent user-facing failure.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Determine whether the cold-load-anchor and retry-failure timeouts also occur on the base before treating them as inherited failures.

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 27, 2026, 1:11 PM ET / 17:11 UTC.

@steipete

Copy link
Copy Markdown
Contributor Author

The completed CI run 40543966986 has four failing E2E test names. Two match the latest completed scheduled main run40541472256 exactly: the hidden explicit-suggestion refresh case and the header/subagents batch case.

The other two are not being classified as inherited. I ran their exact names once on merge basebc197791 and once on this head89f654f5, using the bundled Playwright configuration with Node and one worker. Both runs passed both cases (2passed,4filtered): cached-anchor4.245s base/approximately4s head; terminal-recovery2.412s base/2.356s head.

The CI cached-anchor failure occurs after its cached paint/title/reply/geometry assertions, while awaiting a pre-hello unsubscribe. The terminal-recovery case passed its initial desktop and nested touch-page checks, then timed out with the renderer unavailable and no recorded browser error. Source review found no voice call in either path. These are CI-only failures not reproduced on either revision; I am rerunning only failed E2E jobs3/7 and6/7 once to test that diagnosis. No source, test expectation, or timeout was changed. Node is selected locally because this named E2E configuration runs Playwright.

@steipete
steipete disabled auto-merge October 27, 2026 17:49
@steipete
steipete merged commit f7a6623 into main Oct 27, 2026
114 of 121 checks passed
@steipete
steipete deleted the solid2/w-boot-voice-setup-next branch October 27, 2026 18:57
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 28, 2026
* perf(ui): defer realtime voice selection until call startup

* test(ui): share realtime camera lifecycle cases
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. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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