Repository navigation
perf(ui): defer voice selection to call startup - #186131
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. |
|
Codex review: needs maintainer review before merge. What this changesThis 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.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete 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 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe 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]
Technical reviewBest 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
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +17, Tests 0. Total +17 across 4 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 Reviewed October 27, 2026, 1:11 PM ET / 17:11 UTC. |
|
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. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
* perf(ui): defer realtime voice selection until call startup * test(ui): share realtime camera lifecycle cases
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
c28d2e4294e478ab3d50ba6a776b9c1892d71de7with current head13b4ce02091699fea0d37bc08a2624e459f6e652.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, andwhatsapp(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
bc197791931b3e98dd09a19c68ae3077478c5e2awith runtime headabb4524e0eb76287eed6e5249d08aaf8da2d916a. 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 head13b4ce0.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.
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:
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:buildon each side, followed bynode --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 committedscripts/bench-control-ui-cold-load.tsworkload 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 1calls 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 geometrycases (claw/absolutely, light/dark). All four expect78% translucent colors but receive opaque RGB attheme-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 basec28d2e4. 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 statustimes out atchat-header-subagents.e2e.test.ts:211, andreconciles an explicit suggestion refresh after an event while chat remains held (hidden: true)failsexpected 1 to be +0atchat-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
a809a01passespnpm tsgo:uiand all threechat-cold-load-anchor.e2e.test.tscases. 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, andSessionColdOversizeddiagnostics 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:fullcovers 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.
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; headabb4524e; both use the same fresh canonicalabb4524eharness. 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
ui/src/components/markdown-parser.ts:135ui/src/components/markdown.ts:159ui/src/pages/chat/components/chat-transcript-virtualizer-host.ts:206ui/src/pages/chat/session-approval-projection.ts:92ui/src/pages/chat/chat-pane-header.ts:568ui/src/components/markdown-parser.ts:138ui/src/pages/chat/chat-pane-render.ts:523ui/src/app/app-shell-chrome.ts:124packages/net-policy/src/ip.ts:118ui/src/pages/chat/components/chat-composer-view.tsx:65ui/src/app/app-root.tsx:97ui/src/components/select-picker.ts:22ui/src/pages/chat/chat-pane-session-menu.ts:120ui/src/components/select-picker-view.tsx:86ui/src/pages/chat/tool-stream.ts:497ui/src/components/session-organizer.ts:54ui/src/app/gateway-store.ts:621ui/src/pages/chat/chat-outbox-owner.ts:66ui/src/pages/chat/chat-view.tsx:59ui/src/pages/chat/chat-pane-lifecycle.ts:301ui/src/pages/chat/chat-pane-publication.ts:12ui/src/components/solid/menu.tsx:430ui/src/pages/chat/chat-state-page.ts:356ui/src/pages/chat/components/chat-composer-regions.tsx:73ui/src/pages/chat/chat-pane-history.ts:110ui/src/pages/chat/history-merge.ts:182node_modules/.pnpm/[email protected]/node_modules/markdown-it/dist/markdown-it.mjs:4ui/src/pages/chat/chat-pane-board.ts:650ui/src/app/app-root.tsx:91ui/src/pages/chat/composer-dictation.ts:113ui/src/pages/chat/chat-pane-context.ts:391Functions
ui/src/pages/chat/chat-state-page.ts:356ui/src/lib/board/gateway-provider.ts:152ui/src/lib/sessions/session-roster-refresh.ts:656ui/src/pages/chat/chat-thread.ts:433ui/src/pages/chat/chat-outbox-drain.ts:68ui/src/pages/chat/route-loader.ts:253ui/src/lib/chat/outbox-store-codec.ts:112ui/src/pages/chat/chat-pane-session-menu.ts:120ui/src/components/solid/menu.tsx:430ui/src/pages/chat/chat-realtime.ts:205ui/src/components/modal-dialog.tsx:136ui/src/pages/chat/components/chat-working-indicator.tsx:198ui/src/pages/chat/components/chat-session-workspace.ts:93ui/src/pages/chat/chat-tool-activity-coalesce.ts:218ui/src/plugins/control-ui-view.solid.tsx:61ui/src/components/solid/person-reference.tsx:25ui/src/pages/chat/chat-pane-task-suggestions.ts:312ui/src/components/markdown-json.ts:32ui/src/pages/chat/components/chat-message-bubble-tools.tsx:257packages/markdown-core/src/markdown-code-regions.ts:12ui/src/pages/chat/components/chat-attachments.ts:139ui/src/pages/chat/components/chat-thread-view.tsx:285ui/src/pages/chat/chat-history-hydration.ts:74ui/src/pages/chat/components/chat-agent-run-frame.tsx:257ui/src/pages/chat/components/chat-thread-view.tsx:319ui/src/components/markdown-json.ts:32ui/src/lib/sessions/index.ts:572ui/src/pages/chat/chat-pane-session-controls.ts:264ui/src/lib/chat/outbox-recovery.ts:246Unmapped aggregate
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.