Skip to content

perf(ui): defer dormant Chat presentation and streaming runtime - #183198

Merged
steipete merged 5 commits into
mainfrom
solid2/w-boot-lazy-paths
Oct 25, 2026
Merged

steipete merged 5 commits into
mainfrom
solid2/w-boot-lazy-paths

Conversation

@steipete

@steipete steipete commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Cold Chat evaluates streaming transforms, inactive presentation, and operation implementations before those features are used. This continues #183042 by separating those implementations from the first-screen path.

User Impact

The initial Chat screen retains its existing appearance and behavior while evaluating less JavaScript. Common next interactions download in parallel with the route and evaluate on use; uncommon viewers and operations defer both. No dependency versions, public contracts, or user settings change.

Why This Change Was Made

Streaming Markdown/remend and text transforms now have a live-only entry; range-only micromark removes redundant Markdown AST preparation while retaining the existing grammar and literal protection. First-frame text, status, tool/permission chrome, saved voice captions, mobile header and context summary stay synchronous. Optional media/widgets, Details/context breakdown, provider review, Talk implementation, sidebar menus and mobile operations load at their content or interaction boundary. Commands, goal operations and recovery retain synchronous owner/admission; offline payload storage remains synchronous.

Per-pane live frames retain FIFO custody while the implementation loads, with existing scope/retirement checks before application. Common interaction chunks receive route modulepreloads that do not evaluate modules; downloading is not reported as avoided work. Details CSS is pooled separately from renderer JS, so Outputs cannot pull in Details through a stylesheet import.

Evidence

Exact head: d93f4205d48ac62b2c1bc37f5fd0e57aa1bc0f35; merge base: 0e0d3037943c29811f939d308de9f91eb763f413. Both production bundles built on the same Mac with Node 26.12.1. Candidate build 2026.10.7-d93f4205d48a-2026-10-25T04-53-03.483Z, clean source. These final-head measurements supersede all earlier captures.

Proof Result
Production build + baseline-aware strict performance Pass; zero violations or budget changes
UI typecheck + Solid guard Pass after repair
Integrated Markdown load/retention + streaming 44 pass
Streaming sanitizer/security 71 pass
Focused rendering, mobile/context/header, commands/goals/live FIFO, durable payload and parser tests Pass; no local broad E2E
Saved voice / workspace conflict / exact RTL sidebar regression 1 / 2 / 1 pass
Mobile identity / terminal event repair 2 / 1 pass
Wrapper regression cases 16 exact previously failing cases pass; 92 unrelated skipped
Independent review + author simplification Integrated two-pass review and final repair review: no actionable P0–P2 findings
Production Knip Same sole failure on exact base/head: unlisted ffmpeg, scripts/generate-social-preview.mts; no new unused files/dependencies
Full CI ci:full; exact-head run 40163718181, all selected jobs and openclaw/ci-gate passed
Timing / compile 20 base/base/head triplets per profile; A/A and all samples retained. Aggregate readiness within 5%; unresolved local double-bootstrap episode and CPU tails disclosed below

Total raw CSS remains 52 B over its fixed cap on base; head is 1 B smaller. The base-aware strict checker passes. Startup grows 81 B gzip /77 raw B within the existing allowance, with unchanged requests and one CSS request. This is disclosed growth, not a CPU-win claim.

Structural metric Base Head Delta
Startup gzip B 272,522 272,603 +81
Startup raw B 839,209 839,286 +77
Startup JS requests 7 7 +0
Startup CSS requests 1 1 +0
Chat preload JS gzip B 1,248,422 1,234,215 -14,207
Chat preload JS raw B 3,992,327 3,941,920 -50,407
Chat preload JS requests 26 26 +0
Chat preload CSS requests 3 3 +0
New Session preload JS gzip B 761,437 748,379 -13,058
New Session preload JS raw B 2,459,243 2,413,663 -45,580
New Session preload JS requests 20 20 +0
New Session preload CSS requests 3 3 +0
Total CSS gzip B 303,293 303,055 -238
Total CSS raw B 1,595,573 1,595,572 -1
Total CSS requests 106 105 -1
Chat preload CSS gzip B 136,823 138,350 +1,527
Chat preload JS + CSS gzip B 1,385,245 1,372,565 -12,680
Chat preload CSS raw B 853,119 861,491 +8,372
Chat preload JS + CSS raw B 4,845,446 4,803,411 -42,035
New Session preload CSS gzip B 93,423 93,487 +64
New Session preload JS + CSS gzip B 854,860 841,866 -12,994
New Session preload CSS raw B 571,346 571,624 +278
New Session preload JS + CSS raw B 3,030,589 2,985,287 -45,302
V8-observed raw JS B 4,163,054 4,017,988 -145,066
Executed raw JS B 1,887,943 1,873,604 -14,339
Unused raw JS B 2,275,111 2,144,384 -130,727
Completed network JS raw B 4,500,256 4,434,841 -65,415
Completed network JS encoded B 1,272,279 1,256,536 -15,743
Completed network JS requests 66 66 +0

This step removes 130,727 unused raw B (5.75%). Relative to the agreed campaign reference of 2,379,777 unused raw B, the observed cumulative reduction is 235,393 B (9.89%). The 40% goal remains unmet: 716,518 B remains to reach the desired 951,911 B cumulative reduction (at most 1,427,866 B still unused). Cumulative figures include intervening main changes and are not all attributable to this PR. Completed network JS is 1,008,696 raw B /297,270 encoded B below the original capture, with 107→66 requests.

V8 execution coverage is not compile coverage. Modulepreloaded, unevaluated code still costs network and may cost compilation: head has 416,853 network raw B outside V8 coverage, versus 337,202 on base. Therefore 145,066 fewer V8-observed bytes is not a 145 KB download or compile saving. All 49 script counters reconcile, with no duplicated mapped source among loaded chunks; 26,626 unmapped unused bytes remain in totals. Module/function rankings are alternate exclusive views and must not be added.

The emitted graph confirms all new optional groups stay outside startup/New static imports; common Chat interaction/live/streaming/support groups are preload-only. Full ownership parser/mdast emitted code is absent from ordinary Chat/New. Outputs has no Details renderer edge. New Session retains its pre-existing static composer-menu import on both sides. Mobile chrome remains eager; the People/mobile runtime is deferred. An adopted People trigger remains mounted through desktop parking, preserving identity and lookup cleanup.

Timing, CPU, and parse/compile proof

Head d93f4205d48ac62b2c1bc37f5fd0e57aa1bc0f35. Each profile has 20 complete base/base/head triplets, with nearest-rank p95 and no omitted samples. Aggregate performance is accepted with the lifecycle outlier unresolved, as detailed below; this is not an unqualified no-regression claim.

The workload uses first-load state, cold HTTP cache, production Gateway HTTP with synthetic fixtures, desktop viewport, no bandwidth throttle, and untraced renderer thread CPU. The A/A duplicate is candidate; head is candidate-2. Completed-network totals include preloads and are distinct from V8 executed/unused source.

Localhost

Source: boot-diet-lazy-paths-d93-local/2026-10-25T04-59-49.688Z/summary.json. Host one-minute load range 70.408–98.536; warnings 0; pending/queued samples 0.

Metric Base med / p95 [range] Control med / p95 [range] Head med / p95 [range] Head vs base med / p95 Head vs control med / p95
Enabled composer (ms) 249.35 / 424 [221.7–699] 232.9 / 334 [222.8–353.2] 238.35 / 304.1 [215–324.3] -4.411% / -28.278% +2.340% / -8.952%
Nonempty transcript (ms) 473.85 / 604.4 [416–936] 456.55 / 533 [391.6–558.7] 454.1 / 547.1 [403.3–569.2] -4.168% / -9.480% -0.537% / +2.645%
Inline Canvas ready (host timestamp, ms) 951.3 / 1,253.3 [799.3–1,553.4] 932.5 / 1,110.6 [853.3–1,262.7] 937.6 / 1,095.4 [831.2–2,284.5] -1.440% / -12.599% +0.547% / -1.369%
Script CPU (ms) 565.224 / 629.309 [527.691–709.926] 597.214 / 623.906 [537.07–628.504] 571.275 / 644.852 [535.3–811.45] +1.071% / +2.470% -4.343% / +3.357%
Task CPU (ms) 1,117.042 / 1,198.576 [1,056.919–1,395.818] 1,145.178 / 1,199.045 [1,060.122–1,211.217] 1,126.979 / 1,287.913 [1,065.163–1,828.579] +0.890% / +7.454% -1.589% / +7.412%
Thread CPU (ms) 1,134.751 / 1,215.193 [1,073.636–1,412.2] 1,161.682 / 1,218.793 [1,076.119–1,228.364] 1,142.959 / 1,304.569 [1,080.104–1,851.509] +0.723% / +7.355% -1.612% / +7.038%
Long-task count 2 / 3 [2–3] 2 / 3 [2–3] 2 / 3 [2–3] +0.000% / +0.000% +0.000% / +0.000%
Long-task duration (ms) 144.5 / 210 [129–285] 151.5 / 215 [126–215] 145 / 210 [122–301] +0.346% / +0.000% -4.290% / -2.326%
Completed JS raw B 4,500,256 / 4,500,256 [4,500,256–4,500,256] 4,500,256 / 4,500,256 [4,500,256–4,500,256] 4,434,841 / 4,434,841 [4,434,841–4,434,841] -1.454% / -1.454% -1.454% / -1.454%
Completed JS encoded B 1,272,279 / 1,272,279 [1,272,279–1,272,279] 1,272,279 / 1,272,279 [1,272,279–1,272,279] 1,256,536 / 1,256,536 [1,256,536–1,256,536] -1.237% / -1.237% -1.237% / -1.237%
Completed JS requests 66 / 66 [66–66] 66 / 66 [66–66] 66 / 66 [66–66] +0.000% / +0.000% +0.000% / +0.000%

A/A deltas (median / p95): Enabled composer (ms): -6.597% / -21.226%; Nonempty transcript (ms): -3.651% / -11.813%; Inline Canvas ready (host timestamp, ms): -1.976% / -11.386%; Script CPU (ms): +5.660% / -0.859%; Task CPU (ms): +2.519% / +0.039%; Thread CPU (ms): +2.373% / +0.296%; Long-task count: +0.000% / +0.000%; Long-task duration (ms): +4.844% / +2.381%.

Within-triplet head minus mean bases Median ms / p95 ms [range] Median % / p95 % [range] Positive / 20
Script CPU (ms) -9.418 / 24.757 [-65.16–245.668] -1.548 / 4.541 [-10.481–43.421] 8
Task CPU (ms) 4.078 / 154.188 [-97.124–706.188] 0.362 / 13.6 [-8.26–62.918] 11
Thread CPU (ms) 5.602 / 154.199 [-98.234–712.879] 0.49 / 13.404 [-8.238–62.608] 11

All positive timing cells above 5% (including A/A and pooled-base comparison):

  • aa / Script CPU (ms) / median: +5.660%.
  • headVsBase / Task CPU (ms) / p95: +7.454%.
  • headVsBase / Thread CPU (ms) / p95: +7.355%.
  • headVsControl / Task CPU (ms) / p95: +7.412%.
  • headVsControl / Thread CPU (ms) / p95: +7.038%.
  • headVsPooledBases / Task CPU (ms) / p95: +7.412%.
  • headVsPooledBases / Thread CPU (ms) / p95: +7.038%.

100 ms RTT

Source: boot-diet-lazy-paths-d93-rtt/2026-10-25T05-03-21.934Z/summary.json. Host one-minute load range 77.954–99.515; warnings 0; pending/queued samples 0.

Metric Base med / p95 [range] Control med / p95 [range] Head med / p95 [range] Head vs base med / p95 Head vs control med / p95
Enabled composer (ms) 782.35 / 1,121.9 [755.4–2,942.9] 766.9 / 852 [738.2–889.5] 767.85 / 913.2 [738.3–974.3] -1.853% / -18.602% +0.124% / +7.183%
Nonempty transcript (ms) 963.45 / 1,274.6 [907.1–3,185.7] 937.35 / 1,047.7 [890.1–1,070.9] 946.6 / 1,104 [897.5–1,123.7] -1.749% / -13.385% +0.987% / +5.374%
Inline Canvas ready (host timestamp, ms) 2,485.8 / 3,176 [2,344.8–4,731.3] 2,468.65 / 2,973.4 [2,167.8–2,994.9] 2,521 / 2,784.2 [1,911.8–2,973.1] +1.416% / -12.336% +2.121% / -6.363%
Script CPU (ms) 642.784 / 708.05 [561.464–768.047] 656.432 / 690.098 [591.067–707.503] 628.649 / 687.714 [565.508–693.074] -2.199% / -2.872% -4.232% / -0.345%
Task CPU (ms) 1,292.873 / 1,530.463 [1,133.534–1,548.453] 1,306.488 / 1,357.094 [1,201.442–1,357.442] 1,254.744 / 1,406.362 [1,146.569–1,453.648] -2.949% / -8.109% -3.961% / +3.630%
Thread CPU (ms) 1,311.738 / 1,550.029 [1,149.455–1,567.446] 1,324.7 / 1,374.904 [1,220.173–1,376.513] 1,274.72 / 1,423.519 [1,164.046–1,474.03] -2.822% / -8.162% -3.773% / +3.536%
Long-task count 2 / 3 [1–3] 2 / 3 [1–3] 2 / 2 [1–3] +0.000% / -33.333% +0.000% / -33.333%
Long-task duration (ms) 122 / 182 [61–296] 122.5 / 187 [59–188] 119 / 177 [58–204] -2.459% / -2.747% -2.857% / -5.348%
Completed JS raw B 4,500,256 / 4,500,256 [4,500,256–4,500,256] 4,500,256 / 4,500,256 [4,500,256–4,500,256] 4,434,841 / 4,434,841 [4,434,841–4,434,841] -1.454% / -1.454% -1.454% / -1.454%
Completed JS encoded B 1,272,279 / 1,272,279 [1,272,279–1,272,279] 1,272,279 / 1,272,279 [1,272,279–1,272,279] 1,256,536 / 1,256,536 [1,256,536–1,256,536] -1.237% / -1.237% -1.237% / -1.237%
Completed JS requests 66 / 66 [66–66] 66 / 66 [66–66] 66 / 66 [66–66] +0.000% / +0.000% +0.000% / +0.000%

A/A deltas (median / p95): Enabled composer (ms): -1.975% / -24.057%; Nonempty transcript (ms): -2.709% / -17.802%; Inline Canvas ready (host timestamp, ms): -0.690% / -6.379%; Script CPU (ms): +2.123% / -2.535%; Task CPU (ms): +1.053% / -11.328%; Thread CPU (ms): +0.988% / -11.298%; Long-task count: +0.000% / +0.000%; Long-task duration (ms): +0.410% / +2.747%.

Within-triplet head minus mean bases Median ms / p95 ms [range] Median % / p95 % [range] Positive / 20
Script CPU (ms) -13.386 / 31.833 [-98.345–50.878] -1.969 / 5.362 [-14.461–8.34] 8
Task CPU (ms) -12.591 / 59.343 [-162.935–99.293] -0.985 / 4.979 [-11.732–7.331] 6
Thread CPU (ms) -12.654 / 61.156 [-163.384–100.296] -0.975 / 5.054 [-11.62–7.301] 6

All positive timing cells above 5% (including A/A and pooled-base comparison):

  • headVsControl / Enabled composer (ms) / p95: +7.183%.
  • headVsControl / Nonempty transcript (ms) / p95: +5.374%.

Limits

Fixed base/base/head order and a shared loaded host limit tiny timing claims. Use A/A noise and the written CPU fallback; do not treat an unstable wall result as a latency win. Separate compile diagnostics, V8 coverage, strict asset checks, source review, CI, and visual proof are outside this assessment.

Timing / CPU judgment and outlier

All 120 measured navigations are retained, with both timing processes exiting 0, no harness warnings, no pending/queued work, and no mount-recovery navigation. There are 119 single-handshake navigations and one double-handshake navigation (localhost head run51). No sample was discarded. Native review-init CPU work overlapped localhost startup and initial samples; it exited when16rows had been recorded. The A/A script-CPU median moved +5.660% on localhost, and host load reached98.536 locally/99.515 at RTT. Readiness and CPU are evaluated with the prescribed20triplets and A/A controls, not with a latency-win claim.

Aggregate performance acceptance: all readiness medians remain within5% of both baselines on both profiles. Head readiness p95 improves versus the original base on every surface. Against the second baseline, localhost transcript p95 is +2.645%; RTT composer/transcript p95 is +7.183%/+5.374%. Local task/thread CPU p95 is about +7.4%, with stable medians; RTT CPU medians are lower. Local long-task p95 count is3/3/3 and duration210/215/210ms; RTT is3/3/2 and182/187/177ms (base/control/head). These tails remain visible; this is not a claim that every cell satisfies the simple band.

Local run51 is a real unresolved lifecycle episode, not discarded noise. Its script/task/thread CPU is811.450/1828.579/1851.509ms, versus matched base49 560.004/1123.452/1139.866ms and control50 571.559/1121.331/1137.395ms. Relative to the mean matched bases, the CPU deltas are +43.421%/+62.918%/+62.608%. Canvas readiness is2284.5ms versus1079.9/1056.8ms. Both connects declare the same instanceId and d93 build, at112.7 and1848.2ms; actual JS client/socket identity was not instrumented in this run. It makes109 RPCs versus70/70, reads config twice, and loads the same-digest sandbox twice. No close reason or event sequence history was retained, so its cause cannot be called inherited or unrelated. Fixture events are only catalog/presence, default tick policy is30000ms, and the5000ms inbound check is too late to explain a1.7s repeat-connect interval. There is no scope-upgrade request in the RPC trail.

The aggregate results support landing this as an incremental byte improvement. The single lifecycle episode remains an explicit unresolved observation; these measurements do not establish an unqualified no-readiness-regression conclusion. Four fresh diagnostic captures below do not reproduce it and cannot causally explain it. No additional capture was run to chase it away.

Parse / compile diagnostics

Four fresh canonical captures ran serially as base1/head1/base2/head2, with one fresh browser per capture and the same immutable bundles. Each used the same2,005-byte external --init-script transport diagnostic: a64-entry ring of transport IDs, event names/sequence numbers, and close code/reason/stack, with no payload text. All four exited0 and reported one constructed transport, ordered event sequence1–18, no close, and zero dropped records. This instrumentation was identical on both sides and does not alter the shipped UI.

Coarse V8 parse/compile spans are unioned per renderer thread. Nested parse spans are not added twice; this is not an exhaustive compiler profile. Values below are two diagnostic samples, not an untraced timing distribution.

Compile metric (ms unless count) Base1 Head1 Base2 Head2
Main event count 69 69 69 69
Module compile count 66 66 66 66
All-renderer event count 203 203 202 205
Main wall 4.921 4.495 4.879 4.643
Main thread CPU 4.853 4.447 4.819 4.560
All-renderer wall 80.074 67.420 70.931 68.161
All-renderer thread CPU 70.921 65.527 68.527 65.725
Background parse thread CPU 66.068 61.080 63.708 61.165

Mean all-renderer compilation CPU is69.724ms on base and65.626ms on head (-5.877%); main CPU is4.836→4.504ms. Both pairs are lower on head, so the old13b +26.144% diagnostic is not substituted for this exact-head evidence. No compile/CPU improvement is claimed from two samples.

Fresh mapped post-transcript diagnostics find the same dominant>=50ms task family on both sides: identity-avatar-loader completions and sidebar row/window/icon rendering. Their wall/thread CPU is61.974/60.845 and65.919/63.975ms on base, versus71.123/68.822 and73.485/71.425ms on head. Total>=20ms post-transcript task CPU is305.546/218.347ms on base and215.295/203.563ms on head. These source owners are unchanged and do not identify the cause of untraced run51; no source attribution is inferred across those separate navigations.

Bundle identity

Bundle Commit Build ID
Base/control 0e0d3037943c29811f939d308de9f91eb763f413 2026.10.7-0e0d3037943c-2026-10-25T03-53-53.403Z
Head d93f4205d48ac62b2c1bc37f5fd0e57aa1bc0f35 2026.10.7-d93f4205d48a-2026-10-25T04-53-03.483Z

Reproduction commands and fixture

All commands ran from solid2-w-boot-lazy-paths. No bundle was rebuilt during this proof. These aliases expand to the exact bundles and output root used:

export PATH=/Users/steipete/.local/share/mise/installs/node/26.12.1/bin:$PATH
export NODE_DISABLE_COMPILE_CACHE=1
proof_root=/Volumes/Clawstudio-Storage/openclaw-worktrees
base_bundle=$proof_root/boot-diet-repaired-main-bundle
head_bundle=$proof_root/solid2-w-boot-lazy-paths/dist/control-ui

node --import ./scripts/tsx.mjs scripts/bench-control-ui-cold-load.ts --gateway-http --bundle-dir "$head_bundle" --runs 1 --first-load --cold-http-cache --untraced --coverage --face chat --output "$proof_root/boot-diet-lazy-paths-d93-coverage"

node --import ./scripts/tsx.mjs scripts/bench-control-ui-cold-load.ts --gateway-http --bundle-dir "$base_bundle" --compare-bundle-dir "$base_bundle" --compare-bundle-dir "$head_bundle" --runs 60 --first-load --cold-http-cache --untraced --thread-cpu-time --face chat --network-latency-ms 0 --output "$proof_root/boot-diet-lazy-paths-d93-local"

node --import ./scripts/tsx.mjs scripts/bench-control-ui-cold-load.ts --gateway-http --bundle-dir "$base_bundle" --compare-bundle-dir "$base_bundle" --compare-bundle-dir "$head_bundle" --runs 60 --first-load --cold-http-cache --untraced --thread-cpu-time --face chat --network-latency-ms 100 --output "$proof_root/boot-diet-lazy-paths-d93-rtt"

Compile invocations ran individually, serially, in this order (the loop below spells the same arguments):

for capture in base1 head1 base2 head2; do
  case "$capture" in
    base*) bundle=$base_bundle ;;
    head*) bundle=$head_bundle ;;
  esac
  node --import ./scripts/tsx.mjs scripts/bench-control-ui-cold-load.ts --gateway-http --bundle-dir "$bundle" --runs 1 --first-load --cold-http-cache --face chat --init-script "$proof_root/boot-diet-lazy-paths-d93-transport.init.js" --output "$proof_root/boot-diet-lazy-paths-d93-compile-$capture"
done

Fixture: canonical control-ui-team-scale-fixture.ts, desktop1719×1179, 390sessions/200first-page/30pinned, 34owners/120people/6agents/7plugins/120cron jobs, 240transcript messages/12inline widgets, 6catalog hosts with20sessions each, 12presence events, sidebar sessions with avatars/expanded mode off. RPC latency35ms, frame gap4ms, CPU throttle1, no bandwidth limit, no streaming/session-switch/live-churn phase. First-load state and cold HTTP cache were cleared per sample. Production Gateway HTTP asset serving and synthetic bootstrap/RPC/media were used; immutable Gateway asset-reader caches remained warm per bundle. Quantiles use nearest-rank p95. Coverage ran separately because instrumentation changes execution cost.

Size and ownership

Recounted source LOC over changed .ts/.tsx/.js/.mjs/.mts/.css paths, including styles, tests and helpers, excluding generated manifest/lockfile: production 33,585→34,931 (+1,346) across 135 paths; tests 31,390→32,136 (+746) across 69; tooling 1,227→1,350 (+123) across 5. Growth is extraction entry points, retained current-authority/FIFO custody and regression coverage, without another state owner.

Solid census over 106 changed production UI paths: effects3→3, renderEffects0→0, untrack2→2, cleanup7→7, onSettled30→31, signals24→25, memos154→158, lazy21→31; native listeners0, query1+1, flush2, getOwner2, runWithOwner2 unchanged. Simplification removed failed first-frame and offline-storage deferrals. Domain owners stay plain TypeScript.

CI repairs on the final head

The previous head’s full CI had two PR-caused failures, and both were reproduced. chat-prepared-silence now waits for the actual final literal and terminal run receipt; mock dispatch can finish before the newly lazy event runtime. chat-motion exposed a 17 px mobile footer collapse when acknowledgment removed one of two metadata lines. The footer now uses one status-or-timestamp slot. Queue actions remain available and the timestamp returns after acknowledgment. No scroll workaround, timer or new state. The original full motion file passes 4/4 and the rendering unit file passes 29/29. Held-ACK prompt movement is 17→0 px.

Inspected synthetic mobile before/after proof.

Before / after

Same synthetic desktop Chat fixture, 1719×1179; both final base/head captures inspected in full. No real conversations/account data or incidental desktop content.

Before: base cold Chat

After: dormant runtime boundaries

Top 30 unused-at-boot modules and exclusive functions

Top 30 source modules

# Source Loaded B Executed B Unused B Follow-up
1 node_modules/.pnpm/[email protected]/node_modules/markdown-it/dist/markdown-it.mjs 50,937 18,212 32,725 Common content: initial and subsequent Markdown rendering; unused grammar/renderer branches depend on message syntax. Preserve the first-screen parser and sanitization contract. Optional extensions or content families need measured cuts rather than deferring the whole parser.
2 node_modules/.pnpm/[email protected]/node_modules/dompurify/dist/purify.es.mjs 29,036 16,650 12,386 Common: sanitizing newly rendered Markdown; option/DOM branches are input-dependent. Security-critical; do not bypass. A separate audited feature/build is required to shrink.
3 node_modules/.pnpm/@[email protected]/node_modules/@tanstack/virtual-core/dist/esm/index.js 24,593 14,091 10,502 Common: transcript scroll, resize, item measurement. Runtime callbacks and branches needed after boot; avoid deferring initial geometry.
4 ui/src/lib/protocol-validators.generated/approvals.js 12,069 1,924 10,145 Conditional approval state: validate subscription replay and live approval events, including pending approvals restored at boot. Keep complete replay, event order and untrusted-input admission; a split cannot postpone validation until the approval button is clicked.
5 node_modules/.pnpm/@[email protected]_patch_hash=421b418083c0218bb54ceb3e12bd0eb74a84e86474ca26cc1f1114abbe58de48/node_modules/@solidjs/signals/dist/prod/store/store.js 17,768 7,911 9,857 Common: application state changes; branches depend on data shapes. Core runtime, not an optional feature module; target callers first.
6 ui/src/pages/chat/chat-pane-side-panels.ts 12,328 2,832 9,496 Common panel/mobile-layout owner: derive initial saved panel presentation, then open, close, resize or navigate details/workspace/Side chat panels. Optional companion-answer actions run later. Preserve layout, viewport/focus recovery, observer visibility and current-session admission; a panel can already be visible at boot.
7 node_modules/.pnpm/[email protected]/node_modules/linkify-it/build/index.mjs 11,146 2,176 8,970 Common: Markdown linkification; rare grammar/normalization branches. Part of initial Markdown; avoid blindly moving parser onto a serial critical path.
8 ui/src/pages/chat/chat-pane-sharing.ts 11,476 2,632 8,844 Conditional collaboration: load current-session membership and suggestions, receive typing actors, and publish draft typing previews when multiple identities are present. Add/resolve suggestions are explicit actions. Preserve session-instance, connection and sharing-access checks; isolate suggestion actions from ordered typing admission.
9 ui/src/app/app-shell-chrome.ts 11,796 3,061 8,735 Common shell lifecycle and interaction: mount keyboard/native-command, resize, navigation and file-drag listeners; later open palettes/panels, toggle the drawer or resize the rail. Keep initial navigation geometry and synchronous event/focus handling; feature views already use deferred shell-component requests.
10 ui/src/app/app-root.tsx 12,300 3,643 8,657 Common root: provide application context, mount the shell and report readiness; connection state selects login or Gateway confirmation. Focus/document/approval/question routes select existing lazy views. Preserve the root/connection lifecycle and first-route composition; keep those optional route views lazy.
11 node_modules/.pnpm/[email protected]/node_modules/ipaddr.js/lib/ipaddr.js 12,622 3,975 8,647 Conditional URL/IP input: canonical IPv4/IPv6 parsing supports shared Gateway address checks and link-reader image eligibility. Most address grammar/range branches depend on the host supplied. Keep the existing URL/security decisions; a split must preserve these callers rather than replace their validation.
12 ui/src/pages/chat/components/chat-composer-view.tsx 14,663 6,178 8,485 Common: first-screen textarea, send/stop controls, keyboard/mobile editing and attachment inputs. Banners, recovery, goal/activity content and picker menus depend on state or later interaction. Keep visible controls, draft ownership and browser-gesture admission eager; existing menus already have content boundaries.
13 ui/src/pages/chat/chat-pane-session-menu.ts 10,228 2,077 8,151 Common interaction: header menu, rename, pin; less common archive/move/delete. Keep menu availability and current-session scope; dynamically load action bodies.
14 ui/src/pages/chat/chat-pane-history.ts 9,652 1,808 7,844 Common transcript interaction: establish scroll/sentinel bookkeeping, refresh history and load or prefetch older pages after reader intent. Catalog continuation, branch switching, Fork and Rewind are conditional actions. Keep initial scroll ownership, request scope and ordered transcript commits; isolate mutation continuations.
15 ui/src/components/session-organizer.ts 8,354 540 7,814 Common sidebar interaction: preserve collapsed sections and drag/drop state, admit session mutations and dispatch menu actions. Mutation implementations already load through the operations runtime. Keep synchronous drag data and mutation scope; remaining interaction bodies need a separate measured cut.
16 ui/src/lib/protocol-validators.generated/activity.js 9,362 1,558 7,804 Common conditional content/events: validate prepared chat/tool activity, live tool activity, sidebar narration, observer digests and session reactions. Restored tool-rich history can need it immediately. Keep event/message trust-boundary validation and ordered publication; it is not limited to non-chat workflows.
17 ui/src/pages/chat/chat-outbox-owner.ts 9,454 1,733 7,721 Common after send or reconnect: queue admission/drain/recovery. Keep durable owner/admission; preload send/outbox implementation before first send.
18 ui/src/api/gateway.ts 12,930 5,298 7,632 Common: connection/reconnect, requests and events; many fault paths unused. Transport owner remains eager; do not defer fault handling casually.
19 ui/src/lib/sessions/github-publication-owner.ts 7,568 10 7,558 Conditional publication state: discover/read or resume GitHub publication status for visible pills, potentially at boot; Publish and Confirm are explicit mutations. Keep read ownership, connection/access retirement and idempotent attempt custody; defer only mutation bodies without changing those contracts.
20 ui/src/pages/chat/chat-send-submit.ts 7,427 9 7,418 Common: first send, queue policy, submission validation. Preload send runtime after paint; preserve synchronous admission/activation-sensitive actions.
21 ui/src/components/solid/menu.tsx 9,269 1,926 7,343 Common interaction: open any menu, keyboard navigation, submenu. Potential shared lazy menu content; focus/lifecycle owner must remain coherent.
22 ui/src/pages/chat/chat-pane-lifecycle.ts 13,998 6,670 7,328 Common: every pane mount establishes state, cached history/draft handoffs, subscriptions and the usable-composer readiness signal. Later branches handle focus/shortcuts, annotations, live events, visibility and teardown. Keep connection, media and draft custody synchronous; isolate only optional continuations.
23 ui/src/components/session-progress-card-solid.tsx 10,808 3,758 7,050 Conditional first screen: restored task/progress cards; composer/board variants and menu/refresh actions follow.
24 node_modules/.pnpm/[email protected]/node_modules/entities/dist/decode.js 7,581 534 7,047 Common Markdown/entity decoding. Named-entity tables and parser branches depend on content; initial Markdown decoding remains critical.
25 ui/src/pages/chat/chat-pane-board.ts 11,950 4,924 7,026 Conditional dashboard content plus common layout bookkeeping: resolve provider/availability during pane rendering; restore a saved dashboard at boot or open it later, then select tabs, resize, grant, refresh widgets or save defaults. Preserve scoped provider leases, cached snapshot admission and command ordering.
26 packages/gateway-client/src/session-projection.ts 7,923 909 7,014 Common: initial/history replacement and subsequent send, delta, final, persistence and reconnect reconciliation. Keep the canonical identity/order owner; split event-specific reducers only with synchronous ordered application preserved.
27 ui/src/pages/chat/run-lifecycle.ts 7,992 984 7,008 Common: adopt sent/restored runs and reconcile live/history/session terminal state; Stop is an explicit interaction and pending Stop replay is conditional on reconnect. Preserve run identity, synchronous queue cancellation and terminal publication; this is not an optional renderer.
28 node_modules/.pnpm/@[email protected]_patch_hash=6d6b2e52e607edf3c9cfcc1a26f331d013537d051f43bbb4f3e_d913839875323d2bb83ec59562493c23/node_modules/@solidjs/web/dist/web.js 17,732 10,732 7,000 Common DOM runtime: render/update elements, reconcile lists and dispatch delegated events for later clicks/typing; native select and hydration paths are conditional. Initial DOM insertion already executes. Preserve renderer/event semantics; absent hydration branches are framework packaging candidates, not a lazy page.
29 ui/src/pages/chat/composer-dictation.ts 8,099 1,106 6,993 Rare/optional: voice/dictation. Keep browser gesture admission and audio preparation synchronous.
30 ui/src/pages/chat/chat-view.tsx 13,124 6,132 6,992 Common: first-screen transcript/composer composition and later search, file drop, image opening, reply clearing and history retry. Approvals, suggestions, mobile activities and plugin replacements are conditional content, including at boot; retain visible composition while splitting those content families.

Top 30 module unused total: 270,192 B.

Top 30 functions

# Function / mapped location Loaded B Executed B Unused B Follow-up
1 handleSendChat / ui/src/pages/chat/chat-send-submit.ts:97:1 7,336 0 7,336 Common: first composer send. Preload before send; preserve send admission.
2 board check_0 validator / ui/src/lib/protocol-validators.generated/board.js:50:16 5,458 0 5,458 Conditional snapshot recovery: validate a cached board before restoring its scoped provider, possibly during a saved-dashboard boot. Not required for a plain empty dashboard, and not just a user mutation. Preserve full validation and current lease/scope checks before publication.
3 Unmapped mobile-host CSS initializer / control-ui-boot-chat-CFxe_EMq.js:536237 4,464 0 4,464 Conditional mobile/panel CSS initializer; no source map inside the function.
4 canApplySessionListSnapshot / ui/src/lib/sessions/session-list-query.ts:37:1 4,035 0 4,035 Common live roster updates: decide whether a sessions.changed/session.message snapshot completely covers the active query and can replace another list read. Query filters, ancestor coverage and held rows select unused branches. Preserve certification before publishing a substituted snapshot.
5 buildChatItems / ui/src/pages/chat/chat-thread-build.ts:128:1 5,491 1,741 3,750 Common: already used; unused branches are message/tool families absent from fixture.
6 drainStoredChatOutbox / ui/src/pages/chat/chat-outbox-drain.ts:140:1 3,640 0 3,640 Common on durable queued send/reconnect; absent with clean boot storage.
7 normalizeStoredQueueItem / ui/src/lib/chat/outbox-store-codec.ts:112:1 3,491 0 3,491 Common on durable outbox recovery; absent with clean boot storage.
8 handleHeaderSessionAction / ui/src/pages/chat/chat-pane-session-menu.ts:179:3 3,451 0 3,451 Common interaction: session header menu mutations, with rare destructive variants.
9 startRealtimeTalk / ui/src/pages/chat/chat-realtime.ts:142:29 3,289 0 3,289 Rare/optional: start live voice conversation.
10 createModalPolicy / ui/src/components/modal-dialog.tsx:136:1 3,261 0 3,261 Common interaction: first dialog; focus, dismiss and return-focus lifecycle.
11 loadChatRoute / ui/src/pages/chat/route-loader.ts:252:1 4,071 858 3,213 Common: route changes/revalidation; already partially used for cold route.
12 Menu renderEntries / ui/src/components/solid/menu.tsx:422:26 3,200 0 3,200 Common interaction: open a menu; submenu/entry families need rendering.
13 openWorkspaceItem / ui/src/pages/chat/components/chat-session-workspace-preview.ts:26:1 3,154 0 3,154 Common interaction: open file/workspace preview; not boot critical when closed.
14 coalesceTurn / ui/src/pages/chat/chat-tool-activity-coalesce.ts:216:1 3,202 59 3,143 Common on tool-rich turn; mostly unused because fixture has no such activity.
15 PluginViewContent / ui/src/plugins/control-ui-view.solid.tsx:61:1 3,136 0 3,136 Conditional installed-plugin surface: mount a registered page/panel/widget/inline view or selected transcript/composer replacement, possibly on the first screen. Handle default delegation, scope changes, errors and disposal. Keep registration authority and synchronous outgoing-mount cancellation; absence in this fixture does not imply interaction-only use.
16 PersonReferenceContent / ui/src/components/solid/person-reference.tsx:26:1 3,089 0 3,089 Conditional transcript content: render an explicit person-reference trigger/avatar in initial or later messages; hover, focus or click opens its card. The card runtime already loads separately. Keep trigger accessibility, current connection/profile scope, portal focus and cleanup coherent.
17 resolveTaskSuggestion / ui/src/pages/chat/chat-pane-task-suggestions.ts:321:3 3,079 0 3,079 Rare/optional: accept or dismiss suggested task.
18 WorkingStatus / ui/src/pages/chat/components/chat-working-indicator.tsx:49:1 3,005 0 3,005 Common active-run content: show startup, working, approval/retry or subagent-wait status after sending or when restoring an in-flight run; also used during new-session creation. Renders elapsed time, output tokens, branding and a subagent shortcut. Keep this content ready with the active run, not behind a later click.
19 createScanner / node_modules/.pnpm/[email protected]/node_modules/jsonc-parser/lib/esm/impl/scanner.js:10:1 2,991 0 2,991 Conditional content, common in coding chats: scan JSON-shaped Markdown/code blocks before tree rendering to bound depth/tokens; provider exec-output formatting also uses it. Can run on restored first-screen content. Preserve duplicate members, exact lexemes and Raw/Copy text.
20 ChatPermissionCard / ui/src/pages/chat/components/chat-permission-card.tsx:12:1 2,975 0 2,975 Conditional content: a tool result or guardian notice reports missing device permissions, possibly in restored history. Display local/remote guidance, invoke native permission resolution and offer retry after grants. Load with that content while preserving the native gesture and current-device checks.
21 tokenizeHtmlFlow / node_modules/.pnpm/[email protected]/node_modules/micromark-core-commonmark/lib/html-flow.js:55:1 2,954 0 2,954 Conditional Markdown content: CommonMark HTML blocks; reasoning-tag parsing disables this grammar.
22 hydrateChatHistory / ui/src/pages/chat/chat-history-hydration.ts:73:1 5,181 2,291 2,890 Common: initial chat.startup/history load, refresh and reconnect reconcile the authoritative page with cached/live messages, pending inputs and run state. Extra branches handle cursor reset, in-flight replay and read errors. Keep subscription admission, request ownership and ordered publication on the initial-history path.
23 readChatAttachmentFile / ui/src/pages/chat/components/chat-attachment-reads.ts:231:1 2,771 0 2,771 Common attachment interaction: file selection, paste or drop starts FileReader preparation; larger images resize and oversized videos offer optional compression. Absent on an untouched composer. Keep ordered byte reservations, abort/timeout settlement, upload-policy recheck and payload custody before releasing send.
24 handleTranscriptContextMenu / ui/src/pages/chat/components/chat-thread-interactions.ts:393:1 2,758 0 2,758 Common interaction: right-click a completed transcript message/selection for Copy, Reply, Read aloud, Fork or Rewind. Native controls and streaming content bypass it. Keep event cancellation, clicked-message ownership, modal portal placement and initial focus synchronous; action continuations may be deferred.
25 RunFrame / ui/src/pages/chat/components/chat-agent-run-frame.tsx:255:1 2,645 0 2,645 Conditional transcript content, common in tool-using chats: render a grouped agent run with messages, work/activity sections, source previews, final actions and interruption status. Restored history can need it at first paint; active status-only frames take the smaller StreamGroup path. Preserve keyed ranges and live widget ownership.
26 <anonymous/module> / ui/src/pages/chat/components/chat-comment-pins.tsx:36:4 2,629 0 2,629 Conditional annotation content: mount only while draft attachments contain selection annotations, including a restored draft. Place source pins and track scroll/resize/content mutations; clicking edits the annotation. Keep attachment-owned data, transcript anchors and observer cleanup coherent.
27 reconcileChangedEvent / ui/src/lib/sessions/session-reconciliation.ts:399:5 2,607 0 2,607 Common: sessions.changed and session.message reconcile roster fields, permissions, archive/deletion state and publication status before notifying consumers. Missing from this quiet boot fixture, but required for ordinary live updates. Keep scope/generation admission and ordered owner publication synchronous.
28 visit / node_modules/.pnpm/[email protected]/node_modules/jsonc-parser/lib/esm/impl/parser.js:346:1 2,604 0 2,604 Conditional JSON content: parseTree and formatting use this visitor for JSON-shaped transcript/code blocks and provider exec output, potentially at first paint. Not confined to a config page; any split must preserve literal bytes, duplicate keys and existing parse budgets.
29 consumeChatOutboxRecovery / ui/src/lib/chat/outbox-recovery.ts:314:1 2,522 0 2,522 Conditional recovery: explicit Restore/Discard of retained input, plus automatic retirement after a proven delivery receipt. Keep account claims, synchronous storage transfer and payload custody intact.
30 createTokenizer / node_modules/.pnpm/[email protected][email protected]/node_modules/micromark/lib/create-tokenizer.js:61:1 2,493 0 2,493 Conditional content, common in coding chats: tokenize possible backtick, fenced or indented code so reasoning/tool-tag cleanup preserves literal examples. Plain text takes the cheap no-tokenizer path; retain exact CommonMark/GFM ranges.

Top 30 function unused total: 100,033 B.

Remaining architecture opportunity

The final source audit found no duplicate mapped modules and no direct removable 100 KB island. The entirely unexecuted mapped modules total 137,728 raw B across 197 sources, distributed among owners needed by the first screen. Large whole-pane/sidebar closures include rendering, roster reconciliation and lifecycle code, so their totals are not removable savings. strictExecutionOrder remains intact.

The concrete next restructuring moves canonical tool preparation and conditional rendering behind one prepared-facts boundary. Its 19-module modeled upper bound is 37,515 loaded /32,748 unused raw B, before retained helpers and loading glue. All conditional renderers plus facts cover 49 modules /106,543 loaded /95,900 unused B before retention; first-screen Canvas/media code cannot be counted as absent. These are unmeasured design bounds, not promised savings. Every synchronous consumer must use the same prepared facts before mutable transcript projection; no parallel normalizer or asynchronous mutation of a stale frame. The 716,518 B target gap remains open.

Independent audits put menu/capability deferral at 25–30 KB unused raw after retaining admission/recovery, and shell/pane continuations below 12 KB before glue. Initialized catalogs/tables total about 246 KB raw but mostly count as executed in V8; key-use coverage is absent. Reaching the 40% goal requires broader conditional-rendering/preparation restructuring, rather than adding overlapping inventories or counting worker relocation as removed code.

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

clawsweeper Bot commented Oct 25, 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 25, 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 🔄 Running since 2026-10-25T04:56:49.590610Z d93f420 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.

@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Oct 25, 2026
@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Dependency graph changes

This maintainer PR changes the dependency graph.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: d93f4205d48ac62b2c1bc37f5fd0e57aa1bc0f35
  • Maintainer: @steipete
  • Repository role: admin

These dependency graph changes were made:

  • pnpm-lock.yaml
  • packages/markdown-core/package.json

Carefully review these changes before merging.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8b70907cf0

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +102 to +105
if (pending.events.some((frame) => frame.isCurrent())) {
state.chatError = t("lazyView.staleSubtitle");
}
pending.events.length = 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Publish live-runtime loading failures to the visible error state

If the live-events chunk fails to load, such as after a deployment invalidates its asset URL or the network disconnects, this handler discards the queued frames but writes only chatError. The normal Chat error notice reads state.lastError (chat-pane-render.ts:521), and createChatErrorState maintains those fields independently, so this failure is not shown to the user. The transcript can therefore miss live updates without explaining why or prompting recovery. Use the existing setChatError owner to update both error fields before dropping the frames.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 25, 2026
@clawsweeper

clawsweeper Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR defers Chat streaming, optional presentation, and operation implementations until their existing use boundaries.

Example: Cold-load desktop Chat with settled text history.

  • Before: The reported capture includes 2,273,253 unused raw JavaScript bytes.
  • After: The reported capture includes 2,098,482 unused raw JavaScript bytes, with optional implementations evaluated on use.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful measured optimization with one confirmed recovery defect; broad failing checks remain incompletely attributed.
Proof confidence 🐚 platinum hermit (4/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its exact-head production Gateway cold-load tables support the evaluation savings, while attached screenshots could not be inspected because of review infrastructure limitations.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Opening Chat evaluates implementations for streaming and inactive features before the user needs them.
Reason: The maintainer-authored direction has measured evaluation savings and preserves the existing first-screen contract; the body appropriately avoids claiming a demonstrated latency improvement.

Merge readiness

⛔ Needs changes before merge - 2 items remain

Keep this maintainer-authored performance PR open; its measured evaluation savings are useful, but live-runtime loading failures currently discard updates without showing the recovery notice.

Priority: P2
Reviewed head: 8b70907cf07571496b7551bd3b6118ec145ff685

Before merge

  • Publish live-runtime loading failures through setChatError (P2) - If the live-events chunk cannot download after a deployment or network interruption, this handler clears queued Chat frames but assigns only chatError. The visible Chat error notice receives state.lastError in chat-pane-render.ts:521, and createChatErrorState maintains those fields independently. The user therefore loses live updates without seeing the existing connection-and-reload guidance. Call setChatError(state, ...) here and cover rejected loading through the visible error contract.
  • Complete next step - The PR author should resolve GitHub's reported merge conflict and classify the failing checks before requesting landing.

Findings

  • [P2] Publish live-runtime loading failures through setChatError — ui/src/pages/chat/chat-live-events.ts:102-105

Tests

  • Missing end-to-end proof: The supplied delayed-import tests do not exercise live-runtime import rejection and verify the visible Chat recovery notice.
Agent review details

How this fits together

The Control UI consumes Gateway history and ordered live events, maintains scoped Chat state, and renders transcripts and interaction controls through Solid.

flowchart LR
  A[Gateway history and events] --> B[Chat state owners]
  B --> C[Scoped live event queue]
  C --> D[Deferred streaming runtime]
  B --> E[Settled transcript renderer]
  D --> F[Chat presentation]
  E --> F
  G[User interactions] --> H[Deferred operation implementations]
Loading

Technical review

Best possible solution:

Retain the deferred boundaries and publish loading failures through the existing setChatError owner.

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

Source inspection establishes that rejecting the first live-runtime import clears queued updates while leaving the rendered lastError field unchanged; no executable reproduction was run.

Is this the best way to solve the issue?

Deferring implementations behind existing owners fits the measured problem, and the smallest corrective change reuses the shared error setter without adding another recovery mechanism.

Full review comments:

  • [P2] Publish live-runtime loading failures through setChatError — ui/src/pages/chat/chat-live-events.ts:102-105
    If the live-events chunk cannot download after a deployment or network interruption, this handler clears queued Chat frames but assigns only chatError. The visible Chat error notice receives state.lastError in chat-pane-render.ts:521, and createChatErrorState maintains those fields independently. The user therefore loses live updates without seeing the existing connection-and-reload guidance. Call setChatError(state, ...) here and cover rejected loading through the visible error contract.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.9

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm --dir ui test src/pages/chat/chat-live-events.test.ts
  • pnpm tsgo:test:ui
  • git diff --check
  • Verify a rejected live-runtime download shows the recovery notice while retired panes remain unchanged.

What I checked:

  • Verified introduced change: Reviewed independently verified hunks from merge base 9794c6a to the original PR head, separating them from base movement. (8b70907cf075)
  • Confirmed visible-error defect: The rejection handler assigns only chatError before clearing queued frames; createChatErrorState stores chatError and lastError independently, setChatError updates both, and chat-pane-render.ts:521 presents lastError. This independently confirms the concern raised at perf(ui): defer dormant Chat presentation and streaming runtime #183198 (comment). (ui/src/pages/chat/chat-live-events.ts:103, 8b70907cf075)
  • Performance evidence and accepted scope: The full PR body records exact-head production Gateway cold-load measurements, a 174,771-byte reduction in unused raw JavaScript, and explicitly inconclusive localhost latency. This continues the merged work at perf(ui): defer dormant chat work during cold boot #183042 rather than duplicating it. Captured body identity: b6e041262b3bf3c6ec7cf9d8431739b52040635a589f6c90a867846592df6bbc. (ui/config/control-ui-boot-preloads.ts:19, 8b70907cf075)
  • Stored-format compatibility: The outbox I/O extraction retains the existing outboxPayloads store, serialized record and reference shapes, capacity bounds, ownership checks, and openclaw.control.outboxTab.v1 key; no data migration is introduced. (ui/src/lib/chat/outbox-payload-store.io.ts:18, 8b70907cf075)
  • Current merge and validation state: GitHub reports mergeable=false and mergeable_state=dirty for the reviewed head. Check annotations show UI, type, lint, architecture, and E2E failures; detailed job logs redirect to a blocked Azure host, so their causes are not fully attributable from this review. (8b70907cf075)
  • Inspection limits and clean checkout: Root, UI, and test ancestor policies were read; no maintainer-notes directory exists. Installed Solid documentation is absent, some historical blobs are unavailable, and screenshot downloads failed because the supplied scratch destination was unwritable; browser fetching also failed. No target code or tests were executed, and final git status remained clean. (AGENTS.md:1, 8b70907cf075)

Likely related people:

  • Peter Steinberger: Raw commit b688518 adds ui/src/components/markdown.ts:5 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b688518a2f9a; files: ui/src/components/markdown.ts)
  • Jason Cat: Raw commit 17e09c7 adds packages/markdown-core/src/reasoning-tag-parser.ts:8 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 17e09c778e6b; files: packages/markdown-core/src/reasoning-tag-parser.ts)

PR surface

PR surface statistics unavailable: the file list is incomplete.

Labels

Label changes:

  • add P2: This is a useful cold-load optimization with a bounded, source-confirmed failure-recovery defect.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: This is a useful cold-load optimization with a bounded, source-confirmed failure-recovery defect.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rank-up moves

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

  • Attribute the failed UI and E2E checks to readiness changes, production defects, or independently demonstrated base 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 24, 2026, 11:54 PM ET / October 25, 2026, 03:54 UTC.

@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Oct 25, 2026
@steipete steipete changed the title improve(ui): defer dormant Chat presentation and streaming runtime perf(ui): defer dormant Chat presentation and streaming runtime Oct 25, 2026
@steipete

steipete commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor Author

The final repair preserves mobile prompt position when the Gateway acknowledges a send. Before: delivery status and timestamp wrap into two lines; acknowledgment collapses the footer by 17 px. After: one metadata slot stays 24 px tall and prompt movement is 0 px. Queue actions remain available and the timestamp returns after acknowledgment.

The unchanged full motion file passes all four cases on d93f420. Both captures use synthetic conversation content and were inspected in full.

Before: pending send has two metadata lines

After: pending send uses one metadata slot

@steipete
steipete merged commit a36d048 into main Oct 25, 2026
169 checks passed
@steipete
steipete deleted the solid2/w-boot-lazy-paths branch October 25, 2026 05:22
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 26, 2026
…claw#183198)

* perf(ui): defer dormant chat presentation and streaming runtime

* fix(ui): retain first-frame chat and offline behavior across lazy boundaries

* fix(ui): retain mobile People and complete lazy runtime fixtures

* fix(ui): keep pending-send footer geometry stable
obviyus added a commit that referenced this pull request Nov 28, 2026
…nk (#207550)

## What Problem This Solves

`check-lint-core-5` fails on every PR that runs it:

```
ui/config/control-ui-chunking.ts:178:10: error: Duplicate case label (eslint(no-duplicate-case))
```

#207505 added `case "src/shared/assistant-display-content.ts":` to the `chat-transcript-runtime` list. An older case for the same module (#183198) was already in the `deferred-ui-support` list. In a `switch` the first label wins, so the new case never ran: a build of main still puts the module in `deferred-ui-support`, not where #207505 meant it to go.

## Why This Change Was Made

Remove the stale `deferred-ui-support` case and keep #207505's placement. The only importers of the module are `ui/src/pages/chat/chat-gateway.ts` and `ui/src/pages/chat/chat-live-events.runtime.ts`, and both are in the `chat-transcript-runtime` list.

## User Impact

No visible change. Chat loads the same code with the same number of requests. Routes that use `deferred-ui-support` without Chat download 200 fewer raw bytes.

## Evidence

- `node scripts/run-oxlint.mjs ui/config/control-ui-chunking.ts`: 1 error on main da76574, 0 with this change.
- `pnpm ui:build` on main and on this change. Source maps show `assistant-display-content.ts` in `deferred-ui-support` before and in `chat-transcript-runtime` after. The chunk names are the same; only those two chunks change materially (`deferred-ui-support` -200 B raw, `chat-transcript-runtime` +178 B raw).
- `scripts/check-control-ui-performance.mts --base-dist <main build>`: 0 violations. Chat boot JS 18 -> 18 requests, 1,335,977 -> 1,336,203 B gzip (limit 1,336,272 B), served brotli 1,148,012 -> 1,147,881 B. New Session 16 -> 16 requests.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 29, 2026
…nk (openclaw#207550)

## What Problem This Solves

`check-lint-core-5` fails on every PR that runs it:

```
ui/config/control-ui-chunking.ts:178:10: error: Duplicate case label (eslint(no-duplicate-case))
```

openclaw#207505 added `case "src/shared/assistant-display-content.ts":` to the `chat-transcript-runtime` list. An older case for the same module (openclaw#183198) was already in the `deferred-ui-support` list. In a `switch` the first label wins, so the new case never ran: a build of main still puts the module in `deferred-ui-support`, not where openclaw#207505 meant it to go.

## Why This Change Was Made

Remove the stale `deferred-ui-support` case and keep openclaw#207505's placement. The only importers of the module are `ui/src/pages/chat/chat-gateway.ts` and `ui/src/pages/chat/chat-live-events.runtime.ts`, and both are in the `chat-transcript-runtime` list.

## User Impact

No visible change. Chat loads the same code with the same number of requests. Routes that use `deferred-ui-support` without Chat download 200 fewer raw bytes.

## Evidence

- `node scripts/run-oxlint.mjs ui/config/control-ui-chunking.ts`: 1 error on main 35d95ac, 0 with this change.
- `pnpm ui:build` on main and on this change. Source maps show `assistant-display-content.ts` in `deferred-ui-support` before and in `chat-transcript-runtime` after. The chunk names are the same; only those two chunks change materially (`deferred-ui-support` -200 B raw, `chat-transcript-runtime` +178 B raw).
- `scripts/check-control-ui-performance.mts --base-dist <main build>`: 0 violations. Chat boot JS 18 -> 18 requests, 1,335,977 -> 1,336,203 B gzip (limit 1,336,272 B), served brotli 1,148,012 -> 1,147,881 B. New Session 16 -> 16 requests.

Co-authored-by: Ayaan Zaidi <[email protected]>
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. dependencies-changed PR changes dependency-related files P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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