Skip to content

improve(ui): reduce chat boot work from optional controls - #186004

Merged
steipete merged 18 commits into
mainfrom
solid2/w-boot-row-boundaries-4435
Oct 27, 2026
Merged

steipete merged 18 commits into
mainfrom
solid2/w-boot-row-boundaries-4435

Conversation

@steipete

@steipete steipete commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Cold Chat boot downloads and evaluates optional controls even when the first screen only needs the transcript and composer. Split optional session/menu operations, composer helpers, notices, search, annotations, and their English copy at existing presentation or interaction boundaries. Keep the transcript frame and boot-visible process rows synchronous so cached history has its content on the first commit. Keep shared dependency groups and preload hints to avoid turning the split into a serial round trip.

This is a measured checkpoint, not completion of the boot-diet target: V8-recorded unused code falls by 33,983 B (1.54%), versus the requested approximately 950 KB / 40%. The larger target remains open. Supersedes #183601, #184591, and #184746; the prior-head failures are not claimed as inherited.

No dependency versions, public tags, CSS selectors, routes, authority, or Gateway state owners change. Optional presentation holds references to existing owners. Lazy-load failures remain visible with retry; menus retain keyboard-focus handoff and disposal. Current-row and cached-frame content is deliberately eager.

Evidence

Bundle proof

Same-machine production builds and strict performance checks, base a4a8f632da0a9a2f5ab8ffc2e66fe2b46693ff6a, head 001bfab965c5e9d3948123bb28d4df6db59b767e:

Surface Base raw / gzip JS B Head raw / gzip JS B Raw / gzip delta Requests
Startup 280,423 / 90,201 279,681 / 89,871 −742 / −330 3 JS + 1 CSS, unchanged
Chat 4,066,406 / 1,268,126 3,994,823 / 1,249,238 −71,583 / −18,888 19 JS + 3 CSS, unchanged
New Session 2,492,439 / 771,393 2,474,596 / 767,442 −17,843 / −3,951 15 JS + 3 CSS, unchanged

Chat CSS grows 268 gzip B; total Chat bytes decrease. No budget increase or ignore was added. The strict checker passes.

Cold-load proof and acceptance

Workload: existing committed scripts/bench-control-ui-cold-load.ts, compiled from frozen harness commit 2868c5448f7c98853c5434888485a708a52bae8e. Production bundles served through its isolated Gateway HTTP fixture; desktop synthetic chat, fixed fixture clock, cold page and HTTP cache. Profiles: localhost and 100 ms RTT / 10 Mbps. Twenty interleaved base / same-base A/A / head triplets per profile; separate V8 coverage and eight traced cached-history/active-stream diagnostics. All samples retained. Source/build census matches before and after.

Reproduction after compiling that committed harness (paths select the base/head build directories):

node bench-cold-load.js --bundle-dir "$BASE_BUNDLE" \
  --compare-bundle-dir "$BASE_BUNDLE" --compare-bundle-dir "$HEAD_BUNDLE" \
  --gateway-http --first-load --cold-http-cache --face chat --boot-route chat \
  --viewport desktop --fixture-now-ms 1800000000000 --capture-ms 0 \
  --thread-cpu-time --runs 60 --untraced --network-latency-ms 0 --download-kbps 0
# Repeat profile with --network-latency-ms 100 --download-kbps 10000.
# Separate coverage run: two loads/profile, --js-coverage, same fixture/bundles.

CPU counters span navigation through delivery of the fixture’s 18 events and more than 750 ms of Gateway quiet, including work after first readiness. Task CPU includes script, layout, style, partial compile and other renderer tasks; it is not just first-screen JavaScript.

Acceptance set before runs: median regression at most 5% with p95 no worse; noisy-host A/A control and at least twenty interleaved pairs for CPU interpretation. A move over 20% blocks. Coverage counts guide splitting but are not a substitute for readiness, CPU, or visible behavior.

Exact-head proof

Base a4a8f632da0a; head 001bfab965c5. Equal opening/closing source and bundle census. One sixty-run capture per profile: 20 base / 20 same-base A/A / 20 head loads on localhost and on 100 ms RTT, retaining every sample. Separate coverage and traced diagnostic captures are not pooled into timings.

Profile Bytes/count Base Head Change
local HTTP completed raw JS B 4,554,296 4,493,849 -60,447 (-1.33%)
local HTTP encoded JS B 1,254,548 1,244,537 -10,011 (-0.80%)
local HTTP JS requests 62 62 +0 (+0.00%)
local V8-recorded loaded raw B 4,147,482 4,053,722 -93,760 (-2.26%)
local V8-recorded executed raw B 1,936,038 1,876,261 -59,777 (-3.09%)
local V8-recorded unused raw B 2,211,444 2,177,461 -33,983 (-1.54%)
local HTTP minus V8-recorded loaded B 406,814 440,127 +33,313 (+8.19%)
local HTTP minus V8-recorded executed B 2,618,258 2,617,588 -670 (-0.03%)
rtt HTTP completed raw JS B 4,554,296 4,493,849 -60,447 (-1.33%)
rtt HTTP encoded JS B 1,254,548 1,244,537 -10,011 (-0.80%)
rtt HTTP JS requests 62 62 +0 (+0.00%)
rtt V8-recorded loaded raw B 4,147,482 4,053,722 -93,760 (-2.26%)
rtt V8-recorded executed raw B 1,933,931 1,874,183 -59,748 (-3.09%)
rtt V8-recorded unused raw B 2,213,551 2,179,539 -34,012 (-1.54%)
rtt HTTP minus V8-recorded loaded B 406,814 440,127 +33,313 (+8.19%)
rtt HTTP minus V8-recorded executed B 2,620,365 2,619,666 -699 (-0.03%)

HTTP includes completed preload-only assets and synthetic fixture plugin scripts. V8 records only the frozen harness’s same-origin /assets filter. Their difference is a coverage gap, not universal proof of nonexecution. Encoded bytes are reported as observed, not assumed gzip. Source-map rankings separately partition V8-covered output bytes.

Profile Metric (ms except count) Base median / p95 Same-base A/A median / p95 Head median / p95 A/A Δ% median / p95 Head Δ% median / p95
local Main-thread script CPU 533.73 / 574.96 543.78 / 562.15 547.13 / 580.57 +1.88 / -2.23 +2.51 / +0.98
local Main-thread task CPU 1060.45 / 1202.84 1063.26 / 1094.69 1068.43 / 1246.02 +0.26 / -8.99 +0.75 / +3.59
local CDP compile counter (partial) 0.02 / 0.03 0.02 / 0.02 0.02 / 0.03 +2.78 / -11.54 +5.56 / +7.69
local Route ready 394.75 / 413.80 395.75 / 431.80 391.00 / 423.50 +0.25 / +4.35 -0.95 / +2.34
local Transcript visible 394.90 / 413.90 395.90 / 431.90 391.15 / 423.70 +0.25 / +4.35 -0.95 / +2.37
local Transcript paint 420.00 / 444.00 424.00 / 464.00 418.00 / 444.00 +0.95 / +4.50 -0.48 / +0.00
local Composer enabled 182.05 / 195.20 179.45 / 191.40 180.15 / 185.20 -1.43 / -1.95 -1.04 / -5.12
local Long-task count 2.00 / 3.00 2.00 / 3.00 2.00 / 3.00 +0.00 / +0.00 +0.00 / +0.00
local Long-task total 126.50 / 183.00 123.50 / 179.00 125.00 / 190.00 -2.37 / -2.19 -1.19 / +3.83
local Longest task 64.00 / 69.00 63.00 / 68.00 63.00 / 70.00 -1.56 / -1.45 -1.56 / +1.45
rtt Main-thread script CPU 661.05 / 729.54 662.91 / 691.74 663.31 / 713.53 +0.28 / -5.18 +0.34 / -2.20
rtt Main-thread task CPU 1319.49 / 1435.50 1334.52 / 1412.56 1348.69 / 1440.98 +1.14 / -1.60 +2.21 / +0.38
rtt CDP compile counter (partial) 0.02 / 0.03 0.02 / 0.02 0.02 / 0.02 +0.00 / -8.00 +10.53 / -4.00
rtt Route ready 1408.90 / 1421.00 1405.95 / 1417.20 1398.65 / 1406.80 -0.21 / -0.27 -0.73 / -1.00
rtt Transcript visible 1409.15 / 1421.20 1406.20 / 1417.40 1398.90 / 1407.10 -0.21 / -0.27 -0.73 / -0.99
rtt Transcript paint 1440.00 / 1452.00 1440.00 / 1448.00 1428.00 / 1436.00 +0.00 / -0.28 -0.83 / -1.10
rtt Composer enabled 1409.05 / 1421.10 1406.10 / 1417.30 1398.80 / 1407.00 -0.21 / -0.27 -0.73 / -0.99
rtt Long-task count 1.00 / 2.00 1.00 / 2.00 1.00 / 1.00 +0.00 / +0.00 +0.00 / -50.00
rtt Long-task total 107.00 / 168.00 107.00 / 162.00 106.00 / 114.00 +0.00 / -3.57 -0.93 / -32.14
rtt Longest task 106.00 / 114.00 105.00 / 112.00 106.00 / 114.00 -0.94 / -1.75 +0.00 / +0.00

Timing acceptance is owner-interpreted: ≤5% median regression with p95 not worse, or the stated noisy-host A/A +20-pair CPU rule. The partial CDP compile counter is not total parse/compile CPU. Eight traced/profiled diagnostics report native compilation spans separately and never establish a timing verdict from one sample.

Normalized completed request identities:

  • local: 62 → 62; added en-board-Bl06qPz6.js; removed callback-owner-DwHi_C6e.js.
  • rtt: 62 → 62; added en-board-Bl06qPz6.js; removed callback-owner-DwHi_C6e.js.

Acceptance under the prescribed noisy-host rule

The original same-base A/A p95 changed +4.35% for route readiness and +4.50% for transcript paint despite identical code, triggering the campaign’s noisy-host interpretation. One additional ten-triplet cohort resolved the original CPU-tail concern. Across all 30 pairs, thread-clock script CPU changes +2.82% median / −6.03% p95; task CPU +0.59% / −1.64%; total thread CPU +0.53% / −1.48%. Requests, final rows and delivered events remain 62 / 4 / 18. This supports no aggregate CPU regression under the prescribed noisy-host rule, with fewer loaded/executed bytes.

The raw combined wall-time tails do not all improve: local readiness p95 is 492.0→517.7 ms (+5.22%), transcript paint 536→548 ms (+2.24%), and longest task 105→123 ms (+17.14%); their medians hold or improve. They are disclosed, not labeled passing ordinary p95 checks. The unchanged A/A and cohort-to-cohort tails vary substantially. The 100 ms RTT cohort has readiness median/p95 −0.73%/−1.00% and script CPU +0.34%/−2.20%. No measured cell exceeds the 20% regression stop rule. The thread-clock counters exclude descheduling; they integrate navigation through fixture settlement and do not identify first-ready CPU or individual task causes.

Original, supplemental, and combined localhost samples

One permitted localhost timing confirmation

The original 20 base/base/head triplets and one additional 10-triplet localhost cohort use identical frozen harness options, bundle hashes, source commits and fixture. Opening and closing supplemental censuses also equal the original census. All 90 localhost loads are retained, including both cohorts’ first triplets. Pairing stays within each cohort/triplet. RTT, coverage and diagnostic captures were not repeated. Values below use unrounded samples; nearest-rank p95 and full-precision values are preserved in local-tail-confirmation/analysis/TIMING.json.

Original 20 triplets

Metric, ms except count Base median / p95 A/A median / p95 Head median / p95 A/A Δ%, median / p95 Head Δ%, median / p95
Script CPU 533.727 / 574.957 543.785 / 562.149 547.131 / 580.573 +1.884 / -2.228 +2.511 / +0.977
Task CPU 1060.449 / 1202.842 1063.255 / 1094.688 1068.429 / 1246.015 +0.265 / -8.992 +0.752 / +3.589
Thread CPU 1073.130 / 1217.611 1075.665 / 1107.307 1081.065 / 1260.318 +0.236 / -9.059 +0.739 / +3.507
Route ready 394.750 / 413.800 395.750 / 431.800 391.000 / 423.500 +0.253 / +4.350 -0.950 / +2.344
Transcript visible 394.900 / 413.900 395.900 / 431.900 391.150 / 423.700 +0.253 / +4.349 -0.950 / +2.368
Transcript paint 420.000 / 444.000 424.000 / 464.000 418.000 / 444.000 +0.952 / +4.505 -0.476 / +0.000
Composer enabled 182.050 / 195.200 179.450 / 191.400 180.150 / 185.200 -1.428 / -1.947 -1.044 / -5.123
Long-task count 2.000 / 3.000 2.000 / 3.000 2.000 / 3.000 +0.000 / +0.000 +0.000 / +0.000
Long-task total 126.500 / 183.000 123.500 / 179.000 125.000 / 190.000 -2.372 / -2.186 -1.186 / +3.825
Longest task 64.000 / 69.000 63.000 / 68.000 63.000 / 70.000 -1.562 / -1.449 -1.562 / +1.449

One-minute host load range: 20.238–26.166. Structural values across this cohort: [62] JS requests; [4] final transcript rows; [18] delivered fixture events; [72, 73] RPC counts.

Supplemental 10 triplets

Metric, ms except count Base median / p95 A/A median / p95 Head median / p95 A/A Δ%, median / p95 Head Δ%, median / p95
Script CPU 537.359 / 617.842 546.712 / 575.342 553.569 / 577.837 +1.741 / -6.879 +3.017 / -6.475
Task CPU 1073.809 / 1266.751 1063.184 / 1109.012 1068.037 / 1194.833 -0.990 / -12.452 -0.537 / -5.677
Thread CPU 1087.845 / 1279.238 1076.331 / 1121.931 1080.169 / 1211.868 -1.058 / -12.297 -0.706 / -5.266
Route ready 398.000 / 645.800 389.000 / 464.800 391.650 / 517.700 -2.261 / -28.027 -1.595 / -19.836
Transcript visible 398.150 / 647.200 389.100 / 464.900 391.800 / 517.700 -2.273 / -28.167 -1.595 / -20.009
Transcript paint 430.000 / 684.000 416.000 / 492.000 414.000 / 548.000 -3.256 / -28.070 -3.721 / -19.883
Composer enabled 181.600 / 379.200 181.850 / 237.300 178.800 / 259.500 +0.138 / -37.421 -1.542 / -31.566
Long-task count 2.000 / 3.000 2.000 / 3.000 2.000 / 3.000 +0.000 / +0.000 +0.000 / +0.000
Long-task total 124.000 / 215.000 122.000 / 177.000 122.500 / 207.000 -1.613 / -17.674 -1.210 / -3.721
Longest task 63.000 / 126.000 61.500 / 67.000 62.500 / 123.000 -2.381 / -46.825 -0.794 / -2.381

One-minute host load range: 22.633–25.656. Structural values across this cohort: [62] JS requests; [4] final transcript rows; [18] delivered fixture events; [72] RPC counts.

Combined 30 triplets

Metric, ms except count Base median / p95 A/A median / p95 Head median / p95 A/A Δ%, median / p95 Head Δ%, median / p95
Script CPU 535.938 / 617.842 545.661 / 567.655 551.077 / 580.573 +1.814 / -8.123 +2.825 / -6.032
Task CPU 1061.772 / 1266.751 1063.255 / 1104.599 1068.037 / 1246.015 +0.140 / -12.801 +0.590 / -1.637
Thread CPU 1074.456 / 1279.238 1076.072 / 1118.171 1080.169 / 1260.318 +0.150 / -12.591 +0.532 / -1.479
Route ready 395.300 / 492.000 394.000 / 448.400 391.000 / 517.700 -0.329 / -8.862 -1.088 / +5.224
Transcript visible 395.450 / 492.100 394.150 / 448.500 391.150 / 517.700 -0.329 / -8.860 -1.087 / +5.202
Transcript paint 420.000 / 536.000 422.000 / 468.000 416.000 / 548.000 +0.476 / -12.687 -0.952 / +2.239
Composer enabled 182.050 / 329.100 180.250 / 219.800 180.100 / 259.500 -0.989 / -33.212 -1.071 / -21.149
Long-task count 2.000 / 3.000 2.000 / 3.000 2.000 / 3.000 +0.000 / +0.000 +0.000 / +0.000
Long-task total 125.000 / 215.000 123.000 / 179.000 124.000 / 207.000 -1.600 / -16.744 -0.800 / -3.721
Longest task 63.000 / 105.000 63.000 / 68.000 63.000 / 123.000 +0.000 / -35.238 +0.000 / +17.143

One-minute host load range: 20.238–26.166. Structural values across this cohort: [62] JS requests; [4] final transcript rows; [18] delivered fixture events; [72, 73] RPC counts.

Paired CPU decomposition (head minus its own base, median / p95 ms)

CPU counter Original 20 Supplemental 10 Combined 30
script_ms -1.543 / +42.914 +8.123 / +44.314 +2.077 / +44.314
task_ms -0.199 / +149.280 -10.913 / +162.117 -0.199 / +162.117
thread_ms -0.426 / +149.359 -13.052 / +164.507 -0.426 / +164.507
layout_ms +0.036 / +1.075 -0.350 / +2.470 +0.036 / +1.690
style_ms -1.030 / +5.789 +1.038 / +11.142 -0.869 / +11.142
devtools_ms +0.659 / +3.495 +0.234 / +14.955 +0.589 / +4.101
other_task_ms +1.258 / +154.398 -10.028 / +96.248 -0.817 / +154.398

Paired-delta p95 is a different statistic from the difference between distribution p95 values. CPU counter medians do not add to the median total; neither do their p95s. OtherTask is broad and unattributed, and may include product work. Task and Thread counters span navigation through fixture idle settlement, not only readiness. A/A variation describes the control; it does not automatically waive a head regression.

First-triplet longest tasks, all retained

  • original20 base: 105.000 ms.
  • original20 control: 64.000 ms.
  • original20 head: 129.000 ms.
  • supplement10 base: 126.000 ms.
  • supplement10 control: 60.000 ms.
  • supplement10 head: 123.000 ms.

Confirmation interpretation inputs

  • script_ms head p95 change: original +0.976769%, supplement -6.474956%, combined -6.032125%; combined median +2.824863%.
  • task_ms head p95 change: original +3.589249%, supplement -5.677359%, combined -1.636944%; combined median +0.590051%.
  • thread_ms head p95 change: original +3.507442%, supplement -5.266416%, combined -1.479005%; combined median +0.531711%.
  • route_ready_ms head p95 change: original +2.344128%, supplement -19.835862%, combined +5.223577%; combined median -1.087781%.
  • transcript_visible_ms head p95 change: original +2.367722%, supplement -20.009271%, combined +5.202195%; combined median -1.087369%.
  • transcript_paint_ms head p95 change: original +0.000000%, supplement -19.883041%, combined +2.238806%; combined median -0.952381%.
  • long_task_total_ms head p95 change: original +3.825137%, supplement -3.720930%, combined -3.720930%; combined median -0.800000%.
  • long_task_max_ms head p95 change: original +1.449275%, supplement -2.380952%, combined +17.142857%; combined median +0.000000%.

These are measured inputs to the stated acceptance rule, not an automatic clean verdict. No further timing cohort is authorized. Any unresolved cell remains explicit for the parent lane’s decision; a miss of the unused-byte target is still reported separately.

Diagnostic trace and compilation ledger

Descriptive one-sample diagnostics, not performance acceptance

Eight separate traced/profiled runs are behavioral/causal diagnostics, never pooled with untraced timing cohorts. Native trace compilation unions matching V8 parse/compile/deserialization event spans per renderer thread; values are coarse and non-exhaustive. All-renderer wall time sums per-thread event unions and is not elapsed boot latency; background parse spans can include scheduling or streaming waits. Missing thread clocks stay null; no proportional wall-to-CPU conversion. CDP Performance.V8CompileDuration is also non-exhaustive and is not a measure of full compilation. Historical runs use a warm application snapshot with browser HTTP cache cleared, active-stream runs first-load tool/code streaming. Mock Gateway transport.

Profile / state Role V8 main spans Main CPU ms Main wall ms All renderer CPU ms All renderer wall ms CDP compile ms
local / historical-warm-cache-controlled base 67 0.728 0.777 66.479 79.290 0.021
local / historical-warm-cache-controlled head 67 0.653 0.689 60.293 71.651 0.023
local / active-stream base 65 4.715 4.788 86.846 119.611 0.416
local / active-stream head 61 4.884 4.930 67.829 73.852 0.317
rtt / historical-warm-cache-controlled base 67 0.999 1.034 125.057 2420.434 0.031
rtt / historical-warm-cache-controlled head 67 0.980 1.017 107.456 2413.597 0.023
rtt / active-stream base 65 4.775 4.837 121.308 2423.001 0.355
rtt / active-stream head 61 5.237 5.284 100.326 2450.426 0.321

These values characterize the captured work and instrumentation. They cannot establish a readiness improvement or regression from one traced sample.

Correctness and review

Proof Result
pnpm tsgo:ui Pass on final head
chat-session-workspace-loading.test.ts 21 tests passed, one worker
Affected chunking and cached-row tests Passed on the unchanged affected inputs; no local full suite
pnpm ui:build and strict performance checker Pass; numbers above
Production Knip Seven existing diagnostic lines, byte-identical to base; no new ignores
Independent autoreview Whole change: 15 scoped passes, no P0–P2; final three-file cleanup separately scoped-clean
Simplification / Solid checklist Removed redundant cached-row async boundaries and unused type re-exports; retained owner contracts
Broad CI ci:full; repair head pending. Previous run 40522465991 failed and remains attributed below.

Solid text census across changed production/config files (not a native AST claim): rendering controllers 0→0, effects 3→3, render effects 0→0, untrack 1→1, direct listeners/DOM queries/flush/owner APIs all 0→0; lazy 24→35, onSettled 49→56, onCleanup 3→3.

Physical LOC across the final 151-path union (comments/blank lines included): production/config 32,844→34,012 (+1,168), tests/support 24,667→24,662 (−5), total 57,511→58,674 (+1,163). The union grows because CI repairs touch previously unchanged test files; this is not a 12,000-line addition. Growth is the small lazy entry surfaces, explicit load/error/focus lifecycle, and moved-body contracts needed to preserve interaction behavior. No duplicate registered implementation remains.

CI repair and attribution

Repair head: 361abe32d4cff6b073f87bd9801f9668d783759b. The production repair only extracts the existing composer capability types into a leaf module and renames a shadowed local binding; it does not change runtime behavior or the measured lazy graph. Bundle and timing evidence above remains pinned to 001bf.

Run 40522465991 contained 25 failing executions / 24 distinct test names; none matched the latest completed scheduled main run checked (40513788150, head 200f33bdb28712f25994b4134267515834903d81). They are not claimed as inherited. The repairs retain existing assertions while waiting for first lazy search/menu/notice content, supply current typed fixtures, and explicitly register the modal used by a focus test. The PR context check also required the exact authored headings now used here.

Repair proof Result
Selected failed unit names Initial batch 19 passed / 2 failed; both repaired, then the two remaining names passed (32 unrelated cases skipped)
Selected browser failures Four passed across Chromium and WebKit, 94 unrelated cases skipped
Composer import graph Madge cycle check passed
Core chat test typecheck Passed
Final pnpm tsgo:ui, scoped lint and format Passed; line-cap refactor also passed the commit hook and six selected chat-view tests
Production Knip Seven diagnostics, output byte-identical to the measured merge base; no new ignores
Independent review of repair delta Scoped-clean P0–P2; subsequent edits only combine a type import and format bracket property access
Pending-handoff E2E One targeted run passed / four cases skipped; failure-only diagnostics added, no claim of a product fix

The pending-handoff failure was does not recreate a consumed prompt outside the visible history page after reconnect (expected 0 visible prompt copies, observed 1). Its bounded local attempt did not reproduce it. The next exact-head CI must establish the outcome; the added diagnostics record queue/source/visible-bubble facts on recurrence without weakening its assertions.

A later selective-transcript-body experiment is excluded from this PR. Twenty local and twenty RTT base/base/head triplets showed no consistent CPU win, +2,435 raw HTTP bytes and +375 encoded bytes; local script p95 rose 8.38% and long-task total p95 rose 42.62%. It is rejected, not counted as progress toward the target.

Synthetic visual proof

Inspected complete captures: synthetic-only cached history and active streaming on the exact base/head. First cached facts, final facts, row retention, and anchor position match on both profiles; captured/live anchor shift is zero. These selected images prove the touched first-content invariant, not every menu state. Broad interactions belong to CI.

State Base Head
Cached history Base cached history Head cached history
Active stream Base active stream Head active stream
Top 30 modules and functions by unused-at-boot raw bytes

Top 30 modules and functions unused during cold chat boot

Head 001bfab965c5. Raw UTF-8 bytes; same local coverage capture as the proof table. Common/conditional/rare labels describe reviewed call paths, not measured user frequency. Function and module tables overlap; do not add them.

Modules

# Module / function Unused B Follow-up and rationale Source evidence
1 markdown-it/dist/markdown-it.mjs 32,726 Common: Normal message Markdown; list/table/HTML/reference branches depend on content. ui/src/components/markdown-parser.ts:135
2 dompurify/dist/purify.es.mjs 12,386 Common: Required sanitization; removal cases and alternate DOM API modes depend on input. ui/src/components/markdown.ts:159
3 @tanstack/virtual-core/dist/esm/index.js 11,658 Common: Transcript scroll/resize/ranges; horizontal, lanes and smooth/platform paths vary. ui/src/pages/chat/components/chat-transcript-virtualizer-host.ts:206
4 approvals.js 10,221 Common: Automatic approval replay validation; nonempty variants require approval activity. ui/src/pages/chat/session-approval-projection.ts:92
5 chat-pane-side-panels.ts 9,568 Common: Open conversation/context rails; optional attachment and companion-question paths. ui/src/pages/chat/chat-pane-header.ts:535
6 linkify-it/build/index.mjs 8,970 Common: Common auto-linking capability on rendered messages, conditional on URL-like text. ui/src/components/markdown-parser.ts:138
7 chat-pane-sharing.ts 8,849 Common: Typing/presence are common; suggestion resolution and remote actor states vary. ui/src/pages/chat/chat-pane-render.ts:524
8 app-shell-chrome.ts 8,749 Common: Keyboard/navigation/resize; debug, approval and focus recovery are conditional. ui/src/app/app-shell-chrome.ts:124
9 ipaddr.js/lib/ipaddr.js 8,647 Conditional/common: Media/preview host validation; IPv4/IPv6 and invalid-address cases vary by URL. packages/net-policy/src/ip.ts:118
10 chat-composer-view.tsx 8,530 Common: Typing/send/pickers; queues, questions, voice and goals are state-dependent. ui/src/pages/chat/components/chat-composer-view.tsx:65
11 app-root.tsx 8,514 Common: Shell connection/navigation; login, focused routes and failure surfaces are conditional. ui/src/app/app-root.tsx:97
12 select-picker-view.tsx 8,234 Common: Open/search/navigate pickers; disabled/grouped/windowed variants differ. ui/src/components/select-picker.ts:22
13 @solidjs/signals/dist/prod/store/store.js 8,155 Common: Shared reactive stores; array/nested/reconcile/descriptor branches depend on state shape. ui/src/components/select-picker-view.tsx:86
14 activity.js 7,822 Conditional/common: Live tool/narration/sidebar payloads; optional event union fields vary. ui/src/pages/chat/tool-stream.ts:497
15 session-organizer.ts 7,811 Common: Pin/archive/group/drag actions; write failures and rollback are conditional. ui/src/components/session-organizer.ts:54
16 chat-outbox-owner.ts 7,661 Common: Send/queue/persistence; restored-queue recovery and admission failures are conditional. ui/src/pages/chat/chat-outbox-owner.ts:66
17 chat-view.tsx 7,634 Common: Transcript/composer updates; notices, tasks, approvals and search are conditional. ui/src/pages/chat/chat-view.tsx:59
18 gateway.ts 7,568 Common: RPC/events/reconnect; pairing, auth upgrades, heartbeat and errors vary. ui/src/app/gateway-store.ts:621
19 github-publication-owner.ts 7,560 Common: Publication-enabled panes discover status; publishing/retry require a user action. ui/src/pages/chat/chat-pane-publication.ts:12
20 menu.tsx 7,537 Common: Open/navigate menus; nested, disabled and custom-control bodies vary. ui/src/components/solid/menu.tsx:430
21 chat-send-submit.ts 7,485 Common: First and later sends; command, goal, attachment and offline branches vary. ui/src/pages/chat/chat-state-page.ts:356
22 session-progress-card-solid.tsx 7,417 Conditional/common: Visible progress cards; composer/Details/Board and disclosure variants differ. ui/src/pages/chat/components/chat-composer-regions.tsx:73
23 chat-pane-lifecycle.ts 7,389 Common: Pane/context/session lifecycle; drop/paste and reconnect branches are conditional. ui/src/pages/chat/chat-pane-lifecycle.ts:361
24 session-projection.ts 7,062 Common: New messages/run updates; transport gaps/reconnect/reset select other branches. ui/src/pages/chat/history-merge.ts:182
25 entities/dist/decode.js 7,053 Conditional/common: Markdown entities; numeric/malformed/split input and unused decode API modes vary. node_modules/.pnpm/[email protected]/node_modules/markdown-it/dist/markdown-it.mjs:4
26 composer-dictation.ts 6,995 Rare/opt-in: Opt-in voice dictation, media permissions, cancellation and failures. ui/src/pages/chat/composer-dictation.ts:113
27 chat-pane-history.ts 6,981 Common: Session switch/older history; rewind and attachment restoration are conditional. ui/src/pages/chat/chat-pane-history.ts:33
28 run-lifecycle.ts 6,952 Common: Live/terminal run updates; abort replay, detached and stale recovery branches vary. ui/src/pages/chat/chat-pane-context.ts:389
29 @openclaw/uirouter/dist/index.js 6,829 Common: Session/route navigation; cache, redirects, retries and cancellation vary. ui/src/app-routes.ts:178
30 @solidjs/signals/dist/prod/store/optimistic.js 6,734 Framework/conditional: Shared store-hook installation; later optimistic writes, reconciliation and rollback are conditional. Shared flushes call its empty sweep. node_modules/.pnpm/@[email protected]_patch_hash=421b418083c0218bb54ceb3e12bd0eb74a84e86474ca26cc1f1114abbe58de48/node_modules/@solidjs/signals/dist/prod/store/optimistic.js:394

Functions

# Module / function Unused B Follow-up and rationale Source evidence
1 handleSendChat — chat-send-submit.ts 7,403 Common: First and later sends; command, goal, attachment and offline branches vary. ui/src/pages/chat/chat-state-page.ts:356
2 t — board.js 5,458 Conditional/common: Saved or cached Board snapshots; payload variants depend on Board contents. ui/src/lib/board/gateway-provider.ts:152
3 Unmapped generated span 4,946 Unresolved: Unresolved generated span; related panel CSS imports are context, not a proven mapping. Unmapped; retained separately
4 canApplySessionListSnapshot — session-list-query.ts 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
5 buildChatItems — chat-thread-build.ts 3,779 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
6 drainStoredChatOutbox — chat-outbox-drain.ts 3,657 Common: First queued send and later automatic retry; empty cold boot does not drain. ui/src/pages/chat/chat-outbox-drain.ts:68
7 loadChatRoute — route-loader.ts 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
8 normalizeStoredQueueItem — outbox-store-codec.ts 3,484 Common: Serialize new queued sends or restore saved items; fields vary by message. ui/src/lib/chat/outbox-store-codec.ts:112
9 renderEntries — menu.tsx 3,358 Common: Open/navigate menus; nested, disabled and custom-control bodies vary. ui/src/components/solid/menu.tsx:430
10 startRealtimeTalk — chat-realtime.ts 3,288 Rare/opt-in: Explicit realtime voice start/restart and capability/error branches. ui/src/pages/chat/chat-realtime.ts:205
11 coalesceTurn — chat-tool-activity-coalesce.ts 3,143 Conditional/common: Structured tool activity after send/history; plain turns bypass coalescing. ui/src/pages/chat/chat-tool-activity-coalesce.ts:218
12 PluginViewContent — control-ui-view.solid.tsx 3,141 Rare/opt-in: Configured plugin view mount/update/failure; absent from ordinary text chat. ui/src/plugins/control-ui-view.solid.tsx:61
13 PersonReferenceContent — person-reference.tsx 3,123 Conditional/common: Messages containing person references; cards use a separate lazy runtime. ui/src/components/solid/person-reference.tsx:25
14 resolveTaskSuggestion — chat-pane-task-suggestions.ts 3,085 Rare/opt-in: Accept/dismiss task suggestions, including authorization and failed starts. ui/src/pages/chat/chat-pane-task-suggestions.ts:312
15 WorkingStatus — chat-working-indicator.tsx 3,010 Conditional/common: Pending/active runs; approval, retry, subagent, token and branding states vary. ui/src/pages/chat/components/chat-working-indicator.tsx:189
16 createScanner — jsonc-parser/lib/esm/impl/scanner.js 2,991 Conditional/common: Eligible JSON messages/code/tool output; token forms and errors vary by input. ui/src/components/markdown-json.ts:32
17 ChatPermissionCard — chat-permission-card.tsx 2,975 Rare/opt-in: Missing tool permission card, then user retry/settings actions. ui/src/pages/chat/components/chat-message-bubble-tools.tsx:257
18 tokenizeHtmlFlow — micromark-core-commonmark/lib/html-flow.js 2,963 Rare/opt-in: HTML-block tokenizer is disabled in the reviewed Markdown ownership parsers. packages/markdown-core/src/markdown-code-regions.ts:12
19 readChatAttachmentFile — chat-attachment-reads.ts 2,774 Conditional/common: User adds/pastes a file; compression, progress, abort and failure branches vary. ui/src/pages/chat/components/chat-attachments.ts:139
20 handleTranscriptContextMenu — chat-thread-interactions.ts 2,757 Conditional/common: Transcript context menu for reply/copy and tool/run actions. ui/src/pages/chat/components/chat-thread-view.tsx:285
21 hydrateChatHistory — chat-history-hydration.ts 2,729 Common: History loads on switch/reload/reconnect; stale, retry and merge branches vary. ui/src/pages/chat/chat-history.ts:112
22 openWorkspaceItem — chat-session-workspace-preview.ts 2,667 Conditional/common: Open/reuse/pin workspace files; canonical merge imports alongside the read. ui/src/pages/chat/components/chat-session-workspace.ts:93
23 RunFrame — chat-agent-run-frame.tsx 2,651 Conditional/common: Agent-run rows render the common frame around message/work/activity parts. ui/src/pages/chat/components/chat-agent-run-frame.tsx:257
24 <anonymous/module> — chat-comment-pins.tsx 2,632 Rare/opt-in: Annotation attachments create pins; layout, drag and focus only on that surface. ui/src/pages/chat/components/chat-thread-view.tsx:319
25 visit — jsonc-parser/lib/esm/impl/parser.js 2,613 Conditional/common: JSON tree building after eligibility gates; errors/comments/visitor modes vary. ui/src/components/markdown-json.ts:32
26 reconcileChangedEvent — session-reconciliation.ts 2,609 Common: Automatic session-change events; absent/stale row branches depend on payload. ui/src/lib/sessions/index.ts:572
27 switchChatModel — chat-session.ts 2,550 Conditional/common: Explicit model switch; selection and Gateway outcome branches. ui/src/pages/chat/chat-pane-session-controls.ts:264
28 consumeChatOutboxRecovery — outbox-recovery.ts 2,522 Rare/opt-in: Recover saved outbox work after interrupted sends/reloads. ui/src/lib/chat/outbox-recovery.ts:246
29 createTokenizer — micromark/lib/create-tokenizer.js 2,498 Conditional/common: Markdown code/reasoning parsing; grammar/backtracking paths depend on content. packages/markdown-core/src/markdown-code-regions.ts:12
30 writeProfileAppearancePrefs — server-prefs-profile-runtime.ts 2,481 Rare/opt-in: Appearance/navigation preference writes or replay; already imports at the write. ui/src/app/server-prefs-drain.ts:188

Source maps partition module bytes. Functions own their smallest V8 range but use the dominant mapped source for their label, so generated glue can make a function exceed its named module. The unmapped span remains unresolved; its CSS references are contextual only. V8 execution coverage is not complete parse/compile coverage; the proof reports completed HTTP resources and coarse compilation spans separately.

Exact-head CI repair: 9756485

CI run40528459901 had four failing test names. Three E2E failures match the exact names and errors on scheduled main run40523031614: does not recreate a consumed prompt outside the visible history page after reconnect; keeps new batches in Details and opens Subagents manually without duplicate wait status; and reconciles an explicit suggestion refresh after an event while chat remains held (hidden: true). The remaining people-query unit failure was PR-owned and is repaired here.

The pending people-query case asserted immediately after advancing150ms, before its cold dynamic import resolved. The test now waits for the exact one-request assertion before hydrating selected-session metadata; it retains all pending/resolved, selection, mention-range and no-send assertions. The original pending case failed locally with zero requests. After repair all30 tests in chat-pane-history.test.ts pass on the pinned Bun runner; UI types, scoped lint/format and independent P0–P2 repair review pass. No production input changed, so the existing build/Knip/performance evidence remains applicable. This repair adds two test lines. After the diagnostic removal below, the final changed-file union has tests/support 24,667→24,662; production/config 32,844→34,012.

New exact-head CI is required; the previous run is not claimed green. The three named E2E matches are retained attribution evidence only, subject to failures on the replacement run.

Remaining-target investigation

The approximately950KB unused-raw target remains unmet. Further experiments were kept out of this PR: selective transcript bodies reduced V8-unused bytes but increased actual transferred bytes and local long-task tails; the context-details/PNG split saved4,891 raw bytes but retained an unexplained +27.8% local Other-task p95 after30 interleaved triplets and a bounded trace, so it was retired. Those results are not credited here.

A source/coverage audit of24 session/pane owners and their dependency closure found195,535 unused bytes, but only43,847 unused bytes in a deliberately generous explicit-command subset. That ceiling includes synchronous optimistic/custody prefixes and already-lazy wrappers; it is not achievable savings. Catalog initial discovery, companion hydration, and live row reconciliation are required outside the particular fixture. The link-preview renderers are already lazy: the observed IP dependency is retained by synchronous validated media normalization, whose entire parser/IP closure is21,684 raw/16,735 unused bytes. Catalog data also accounts for168,610 raw English bytes, marked executed during initialization; the existing namespace splits above remove optional copy without changing its owner. No100KB new independent boundary was established by these audits. Larger gains require restructuring the remaining synchronous normalization/live-state consumers; they are not claimed by this checkpoint.

Test-line repair: 1d913ae

Run 40535513116 passed every UI unit shard and repeated the same three named E2E failures seen on completed scheduled main run 40523031614. Its additional test-line failure was PR-owned: the branch added 54 lines while main was above the cap. This head removes only the 59-line failure-facts diagnostic import/block from the pending-handoff test; the complete scenario and every assertion remain. That file is now identical to the tested baseline. pnpm check:test-lines-ratchet --base 3bffe4f023190761d875238ed34c9e8f1b54106e passes with net delta −5. Independent P0–P2 review is scoped-clean. No runtime changed, and the existing measured build/coverage/timing proof remains applicable. Fresh ci:full CI is required for this head; prior failures are historical attribution, not current-head admission evidence.

Completed exact-head CI: 1d913ae

CI attribution: PR #186004 at 1d913ae

Every non-aggregate failed job is an exact-name inherited E2E failure. The completed run has three failed E2E jobs and the downstream CI gate; there are no new failed test names. The test-line ratchet, all UI unit shards, type checks, lint, and security-fast passed. CI itself remains failed; this report does not call it green.

Exact identities

PR run 40540105520, attempt 1, head 1d913aefd309a6362ca28ae0ac00b2deabf0cff5, completed at 2026-10-27T16:43:14Z. All 70 jobs were complete in the 16:44 UTC observation. Each failed E2E log declares checkout 9c61b0d43b065bf12ab338fa4b817c2b2764fb5f: merge of head 1d913aefd309a6362ca28ae0ac00b2deabf0cff5 into baseline 6c5e22056d96951c1d306b6838f68173cb23d7e7. The retained object has exactly those ordered parents.

Latest completed scheduled main: run 40532514201, head c168d2b0b7fb11f4cd463191a4f508c6775fbc9b, completed 2026-10-27T16:27:23Z. Newer run 40541472256 was queued at the observation. Only its two failed E2E job logs were needed for this comparison; unrelated main failures are not used to excuse the PR.

Every failed test

PR job File and full test name Error Main comparison
122316901734 ui/src/e2e/chat-startup-priority.e2e.test.ts — Chat startup request priority > reconciles an explicit suggestion refresh after an event while chat remains held (hidden: true) AssertionError: expected 1 to be +0 // Object.is equality Main job 122289581683; exact name/error and source match.
122316901875 ui/src/e2e/chat-send-pending-handoff.e2e.test.ts — Control UI chat send pending handoff > does not recreate a consumed prompt outside the visible history page after reconnect AssertionError: expected 1 to be +0 // Object.is equality Main job 122289581172; exact name/error and source match.
122316901918 ui/src/e2e/chat-header-subagents.e2e.test.ts — Chat header and delegated work > keeps new batches in Details and opens Subagents manually without duplicate wait status TimeoutError: locator.waitFor: Timeout 30000ms exceeded. Main job 122289581172; exact name/error and source match.

The handoff assertion is expect(latestPromptCount).toBe(0) at line 517 in both sources. The subagents case waits 30 seconds for the active pane's 1 subagent running button at line 211. The startup case fails the same historyText count assertion at line 235. Each PR E2E job reports exactly one failed test; repeated summary entries were deduplicated.

Independent proof and source identity

1d913aef-source-equality.json records exact blob equality for all three test files across latest completed main, tested baseline, PR head, and tested merge. 1d913aef-admin-delta.json binds the native raw-diff SHA-256 6dec01117185e703672d7fb7945592e51db41eb92febad60072df16ebb65cad0. Its delta is baseline-to-head, so its changed-path list includes main history absent from the branch; the tested merge is the actual CI tree.

Passing exact-run job 122317755631 records [ok] pnpm tsgo:ui at log line 1804. Passing ratchet job 122316902042 records net delta: -5 and [ok] test-lines at lines 1756–1757; the root-owned diagnostic removal is proven on this head. The metadata also shows all three UI unit jobs and the single security-fast job successful.

Gate job 122328362712 reports only the failed E2E group and has no independent failing test. The proposed native version-1 evidence is ADMIN-EVIDENCE-1d913aef.json; it accounts for all three failed root jobs and this aggregate. REVIEW-PREEXISTING-CI-1d913aef.json supplies the matching review fragment for root to inspect and apply. Neither file modifies native state.

@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-27T16:25:12.513494Z 1d913ae 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.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui scripts Repository scripts size: XL labels Oct 27, 2026
@steipete
steipete enabled auto-merge (squash) October 27, 2026 14:43
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 27, 2026
@clawsweeper

clawsweeper Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR defers optional Chat controls, helpers, notices, and English catalogs while retaining boot-visible transcript content.

Example: Cold-load Chat with the supplied desktop fixture.

  • Before: The production Chat graph contains 1,268,126 gzip bytes of JavaScript.
  • After: It contains 1,249,238 gzip bytes, with unchanged reported request counts.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Credible measured boot evidence supports the direction, but the introduced architecture failure and broken affected tests prevent a pass.
Proof confidence 🐚 platinum hermit (4/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its supplied exact-head production-browser measurements and inspected screenshots support cold boot, cached history, and active streaming.
Patch quality 🦪 silver shellfish (2/6) 6 actionable review findings remain.

Product

Kind: Performance · Worth it: Yes · Fix scope: Partial
User problem: Cold Chat loads optional control implementations before the initial transcript and composer need them.
Reason: The maintainer-authored direction has a measured byte reduction and preserves existing owners, while explicitly delivering only a checkpoint toward the larger target.

Merge readiness

⛔ Needs changes before merge - 6 items remain

Keep this PR open: the maintainer-directed boot improvement has measured value, but an introduced import cycle and incomplete test cutovers need repair.

Priority: P2
Reviewed head: 001bfab965c5e9d3948123bb28d4df6db59b767e

Before merge

  • Break the capability host's circular type dependency (P2) - This new import creates a static cycle: chat-composer-plus-menu.types.ts imports ChatComposerCapabilityHost, while chat-composer-capability-host.tsx imports ChatComposerCapabilityMenuProps from this file. scripts/check-madge-import-cycles.ts includes type-only static imports, so erasure at runtime does not avoid the architecture failure reported for this head. Put the shared contract below both consumers without importing the implementation back into its own props contract.
  • Retain the returned slash-menu host in the dismissal test (P2) - The extraction moves host into mountSlashMenu, but this destructuring drops it while the same test still calls menu.update("/", host) at line 94. That identifier is now out of scope, producing the exact-head ReferenceError before the reopened-menu assertions run. Destructure host alongside menu and view.
  • Update all test consumers of the new asynchronous views (P2) - The notice extraction makes first rendering asynchronous, but chat-view.test.ts still immediately requires .chat-error after renderChatView, including line 360; exact-head CI fails before testing diagnostic preservation. The search extraction similarly leaves immediate input assertions in chat-transcript-invalidation.test.ts, chat-transcript-replies.test.ts, and chat-transcript-render.test.ts. Update these consumers to await the actual rendered controls, preserving their existing assertions rather than eagerly importing production modules to hide the boundary.
  • Migrate the lazy-sidebar dashboard fixture to the source contract (P2) - DashboardPanel now requires ChatBoardPanelSource, but chat-pane-sidebar-layout.lazy.test.tsx:93 still supplies the former { error, surface } props. buildChatBoardPanel therefore receives no board and throws while reading board.provider; exact-head CI shows the error boundary instead of the expected textbox. Update that fixture to the new source contract so the retained-panel lifecycle test exercises the intended path.
  • Seed the selected session before asserting a real unpin (P2) - This test now invokes the real action instead of a spy, but its session exists only in the renderPaneHeader argument: state.sessionsResult never receives that row. runChatHeaderSessionAction deliberately rejects toggle-pin when selectedChatSessionRow(state) is absent, so the pinned navigation entry remains and this new assertion fails in exact-head CI. Populate the authoritative session fixture and keep it aligned when the row is replaced.
  • Anchor the browser assertion to a stable menu locator (P2) - While the new lazy menu displays Loading, page.elementLocator(menu) generates a locator containing that transient text. Once Terminal renders, that ancestor locator no longer matches, so polling never reaches the visible item. The exact-head failure prints a Loading-text ancestor locator while its ARIA tree already contains Terminal. Locate the menu through a stable host selector or accessible identity before waiting for its item.

Findings

  • [P2] Break the capability host's circular type dependency — ui/src/pages/chat/components/chat-composer-plus-menu.types.ts:13
  • [P2] Retain the returned slash-menu host in the dismissal test — ui/src/pages/chat/components/chat-composer-menu.test.tsx:84
  • [P2] Update all test consumers of the new asynchronous views — ui/src/pages/chat/chat-view-notices.tsx:19-26
Agent review details

How this fits together

The Control UI renders Gateway session facts through retained pane owners; this change moves optional presentation and interaction implementations behind lazy boundaries.

flowchart TD
  A[Gateway session facts] --> B[Retained pane owners]
  B --> C[Transcript and composer]
  B --> D[Optional control triggers]
  D --> E[Lazy presentation modules]
  E --> F[Existing mutation owners]
  F --> A
Loading

Technical review

Best possible solution:

Retain the lazy boundaries and existing owners, remove the circular type dependency, and complete the affected test cutover.

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

The import cycle and test defects are directly visible in source and corroborated by exact-head CI annotations; no target code was executed.

Is this the best way to solve the issue?

Deferring optional work through existing owners is coherent, and the remaining defects can be repaired without expanding the design.

Full review comments:

  • [P2] Break the capability host's circular type dependency — ui/src/pages/chat/components/chat-composer-plus-menu.types.ts:13
    This new import creates a static cycle: chat-composer-plus-menu.types.ts imports ChatComposerCapabilityHost, while chat-composer-capability-host.tsx imports ChatComposerCapabilityMenuProps from this file. scripts/check-madge-import-cycles.ts includes type-only static imports, so erasure at runtime does not avoid the architecture failure reported for this head. Put the shared contract below both consumers without importing the implementation back into its own props contract.
    Confidence: 1
  • [P2] Retain the returned slash-menu host in the dismissal test — ui/src/pages/chat/components/chat-composer-menu.test.tsx:84
    The extraction moves host into mountSlashMenu, but this destructuring drops it while the same test still calls menu.update("/", host) at line 94. That identifier is now out of scope, producing the exact-head ReferenceError before the reopened-menu assertions run. Destructure host alongside menu and view.
    Confidence: 1
  • [P2] Update all test consumers of the new asynchronous views — ui/src/pages/chat/chat-view-notices.tsx:19-26
    The notice extraction makes first rendering asynchronous, but chat-view.test.ts still immediately requires .chat-error after renderChatView, including line 360; exact-head CI fails before testing diagnostic preservation. The search extraction similarly leaves immediate input assertions in chat-transcript-invalidation.test.ts, chat-transcript-replies.test.ts, and chat-transcript-render.test.ts. Update these consumers to await the actual rendered controls, preserving their existing assertions rather than eagerly importing production modules to hide the boundary.
    Confidence: 0.99
  • [P2] Migrate the lazy-sidebar dashboard fixture to the source contract — ui/src/pages/chat/chat-pane-embedded-view.tsx:360
    DashboardPanel now requires ChatBoardPanelSource, but chat-pane-sidebar-layout.lazy.test.tsx:93 still supplies the former { error, surface } props. buildChatBoardPanel therefore receives no board and throws while reading board.provider; exact-head CI shows the error boundary instead of the expected textbox. Update that fixture to the new source contract so the retained-panel lifecycle test exercises the intended path.
    Confidence: 1
  • [P2] Seed the selected session before asserting a real unpin — ui/src/pages/chat/chat-pane-session-menu.test.ts:295-296
    This test now invokes the real action instead of a spy, but its session exists only in the renderPaneHeader argument: state.sessionsResult never receives that row. runChatHeaderSessionAction deliberately rejects toggle-pin when selectedChatSessionRow(state) is absent, so the pinned navigation entry remains and this new assertion fails in exact-head CI. Populate the authoritative session fixture and keep it aligned when the row is replaced.
    Confidence: 0.99
  • [P2] Anchor the browser assertion to a stable menu locator — ui/src/pages/chat/components/chat-pane-header.browser.test.tsx:366-370
    While the new lazy menu displays Loading, page.elementLocator(menu) generates a locator containing that transient text. Once Terminal renders, that ancestor locator no longer matches, so polling never reaches the visible item. The exact-head failure prints a Loading-text ancestor locator while its ARIA tree already contains Terminal. Locate the menu through a stable host selector or accessible identity before waiting for its item.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Lazy menu presentation and focus keeps the original intent (353db54: Defer menu construction while retaining native overlay authority, keyboard focus, cancellation, and retry.)
  • Shared header session actions keeps the original intent (46fab66: Share session-management presentation with the sidebar and re-resolve mutation targets through existing owners.)
  • Composer suggestion editing lifetime keeps the original intent (e89e5ad: Keep suggestion state and keyboard behavior synchronous while deferring optional rendering and person-card work.)
  • Lazy English catalogs keeps the original intent (e42e9b5: Load session copy with its consumers while preserving shared labels, namespace identity, and canonical catalog composition.)
  • Cold-route preload hints changes intended behavior with a stated reason (a5690b3: Preload route boot dependencies to avoid serial network waits; this PR explains using lower-priority script preloads for interaction-only assets.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm check:madge-import-cycles
  • pnpm tsgo:ui
  • pnpm --dir ui test src/pages/chat/components/chat-composer-menu.test.tsx src/pages/chat/chat-pane-session-menu.test.ts src/pages/chat/chat-pane-sidebar-layout.lazy.test.tsx
  • pnpm --dir ui test src/pages/chat/chat-view.test.ts src/pages/chat/chat-view-notices.test.tsx src/pages/chat/chat-pane-startup-publication.test.ts src/pages/chat/components/chat-transcript-invalidation.test.ts src/pages/chat/components/chat-transcript-replies.test.ts src/pages/chat/components/chat-transcript-render.test.ts
  • pnpm --dir ui test src/pages/chat/components/chat-pane-header.browser.test.tsx

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 12a56d4 adds ui/config/control-ui-chunking.ts:1 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 12a56d4d46dd; files: ui/config/control-ui-chunking.ts)

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Production versus test growth Production/config net +1,163 lines; tests/support net −39 lines The growth provides lazy entry contracts and loading lifecycles while removing the moved implementations; its cost should be weighed against the measured checkpoint.
Measured Chat reduction 18,888 fewer gzip bytes; 33,983 fewer V8-recorded unused raw bytes The supplied comparison demonstrates a modest reduction and explicitly leaves the larger boot-diet target unfinished.

Root-cause cluster

Relationship: canonical
Canonical: #186004
Summary: The author designated this PR as the replacement checkpoint for three retired performance PRs.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add P2: This is a bounded startup improvement with concrete architecture and test repairs, without an established urgent runtime regression.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🐚 platinum hermit and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: This is a bounded startup improvement with concrete architecture and test repairs, without an established urgent runtime regression.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🐚 platinum hermit and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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, 10:54 AM ET / 14:54 UTC.

@steipete
steipete disabled auto-merge October 27, 2026 14:55
@steipete
steipete merged commit f3bddd1 into main Oct 27, 2026
121 of 127 checks passed
@steipete
steipete deleted the solid2/w-boot-row-boundaries-4435 branch October 27, 2026 17:01
@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
…86004)

* perf(ui): load session management copy with its dialog

* build(ui): refresh boot groups after session copy split

* perf(ui): separate deferred chat rows by importing entry

* perf(ui): retain compressed groups for deferred chat rows

* perf(ui): group deferred run rows and delay voice easing setup

* perf(ui): defer optional chat presentation and controls

* fix(ui): retain board controls across lazy presentation

* perf(ui): keep optional presentation in existing request groups

* perf(ui): isolate visible chat rows from interaction code

* perf(ui): share the boot callback projection chunk

* perf(ui): share the cold avatar kickoff turn

* fix(ui): keep cached chat frames ready on first commit

* refactor(ui): keep boot-visible process rows synchronous

* refactor(ui): make lazy preview dependency explicit

* fix(ui): align lazy chat fixtures and capability types

* test(ui): await deferred people query before hydration

* test(ui): remove redundant pending handoff diagnostics
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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant