perf(agent-pane): defer mock fixtures and preload startup module
Native chats eagerly loaded the mock daemon and synthetic debug transcripts. Load those modules only when a mock page or an existing async debug command needs them, reducing eager JavaScript by 76,592 bytes (1.59%). Preload the module before locale scripts and styles; evaluation still follows localization.
Leo: “things should be instant and not shift layouts AND not take many resources”. This reduces bytes on the open-to-page-painted path. It does not establish a startup timing improvement or meet the under-300 ms goal by itself.
Mock gallery/dev entries prepare the daemon before mounting, preserving the ready handshake's synchronous ordering. Native connection ordering stays unchanged. The localization scanner classifies the extracted debug-fixture barrel alongside the existing debug helpers. No timers, observers, loops, warm browser, or persistent idle activity are added. No new idle memory is reserved; runtime RSS was not measured for this bundle change.
Validation at final head e0ea71b8eaa2f7faacdee2419bb9309cc06350f0:
- CI 41649028843 succeeds, including all eight per-test webview base verdicts. Compile succeeds.
- Focused localization check: 3 pass / 0 fail, including shipped-code import detection.
- Production-equivalent fleet check at
9f1ce1b1passes 20 focused tests, full web formatting/lint/types/protocol checks, and ten light/dark gallery cases. The final delta is only the test scanner's exemption. - Opus 5.5 medium SHIP at the final head.
Performance against base 2a48ef76ce442a85d2c83af440b49d13726a87d3:
| Metric | Before | After | Delta | Run link |
|---|---|---|---|---|
| Eager JavaScript bytes, entry plus static imports | 4,821,604 | 4,745,012 | −76,592 (−1.59%) | Fleet 41643000975 |
| Big chat page-painted, native observations | 663.1 ms | 1182.5 ms | Not comparable: different workers/load | Private report |
| Bloated chat page-painted, native observations | 700.6 ms | 1095.8 ms | Not comparable: different workers/load | Private report |
Both native arms used scripts/measure/chat-open.sh --conditions=idle --cases=big,bloated --runs=3 --turns=10000; six opens completed per arm without timeout or flash. The after arm is intermediate head 23980936ffe3ecb3897670a2584d58462823812c, not the final head. Most timing difference occurred before navigation. These observations support no causal speedup or regression claim; the demonstrated improvement is fewer eager bytes.
Final red attribution:
- Tier routing:
PullRequestTiers.test_every_routed_input_triggers_the_workflowfails on the same fourskills/cmux-customizationpaths in the completed exact-base job at4575ff48a5502d89384180a933114a5a3eea4e90. Test, workflow, router and input blobs match the PR merge. - Focused gallery comparison 41655759891 hash-verifies the complete base
4575ff48and merge0a34ea94trees. All 177 emitted CSS files are byte-identical (2,441,026 bytes). Five light/dark passes per arm reproduce both exact failures on base:new-tab#suggestions-chat-url, shift 0.0473 against 0.03673 while typing; andcomposer-context#started-browse-error, 5,000 ms alert timeout. Both also pass in other runs. These scenes execute unchanged preview/component branches, not the changed mock/debug branches.
Nonblocking follow-ups: #33792 (broader lazy-module sentinels), #33793 (isolate preload benefit), #33794 (mock-load diagnostic).
Agent session: agent session