Skip to content

perf(control-ui): restore cached transcript row facts together - #184334

Merged
steipete merged 4 commits into
mainfrom
steipete/coldload-cached-row-facts
Oct 26, 2026
Merged

steipete merged 4 commits into
mainfrom
steipete/coldload-cached-row-facts

Conversation

@steipete

@steipete steipete commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Peter asked to “store more data offline so loading isn't as visible.” The initial campaign measurement recorded 14 visual states over about 15 seconds on a signed-in reload of a dashboard deep link. This change addresses the later additions inside cached transcript rows: reactions, failure notices, activity summaries, and metadata.

Why This Change Was Made

Persist the missing reaction summaries and context-window fact in the existing bounded disposable transcript snapshot. Raw messages already contain failure, activity, usage, and model facts; reuse those instead of duplicating them. Render cached summaries and retained run-frame child ranges with their row, then reconcile authoritative updates in place. Optimistic reactions remain presentation-only; saved facts are scoped to the same session incarnation and credential scope. The disk window remains 80 messages. Projection version 3 → 4 resets mismatches, without a compatibility reader or Gateway/server-storage change.

The run-frame owner retains widget custody and its existing update effect. Its delayed initial publication is removed. A small eager failure-notice dispatcher replaces the former delayed path; other notice details stay lazy. The frame's retained body preserves the existing eight-pixel activity boundary spacing.

The requested lazy/preload attempt was measured in 11 eager/preload pairs per route. First-row medians were unchanged: chat 608 → 608 ms, dashboard 580 → 580 ms; both paired medians were zero. The smaller eager version was retained and the preload machinery deleted. This experiment does not isolate evaluation cost from DOM/layout cost.

User Impact

Cached chat rows stop growing after they first paint: 58 → 0 px, with at most one later structural frame in 10/11 reloads and no cached-row growth in 11/11. Final rows arrive about 211 ms sooner. Dashboard improves partially, as accepted by the campaign lead.

Accepted tradeoff

The campaign lead explicitly accepted +28 ms chat / +16 ms dashboard first rows, +9,415 snapshot bytes (39,095 → 48,510), and dashboard CLS +0.004 (0.031 → 0.035). The final rebased comparison reproduces those costs. Chat CLS improves in 10/11 pairs, with a paired median delta of −0.049. #180569 is the precedent for accepting a bounded reload cost to eliminate visible flicker.

Peter approved exactly one initial-sampling untrack and its one baseline entry on October 25, 2026, as conveyed by the campaign lead. The inline comment explains why the initial sample must not subscribe the frame owner; the existing effect owns later updates. No other allowance grows.

Chat LoAF blocking is 189 → 200 ms; IQRs overlap (179.5–198 → 187–229.5), with five better and six worse pairs. This is not a regression under the declared paired/IQR rule. Hello, FCP, and final-row timings show no additional regression. The first-row and dashboard CLS costs are explicit accepted tradeoffs.

Evidence

Current PR head 66e86608f6cad258eb0981e1b8cad67435a4a886, rebased onto main bcfdc7205c0068ade5ba646fe9427952e7703f8c. The rebase preserves every touched production file byte-for-byte; its only touched-file difference is main’s test-helper cleanup, and that file passes 2/2 after conflict resolution (11.03 s wrapper wall time). Main still uses projection v3, so this PR keeps its approved v4 reset.

Measured candidate fe3e802f640a63bf5f4e734d58fa84425095c856, baseline 54408a978fc91fd20130b6f904534b47c8dfe25a. AWS Crabbox cbx_f1a7eb051156, fixed c7a.4xlarge, 16 observed CPUs and 32 GiB class. Run.

Eleven interleaved baseline/candidate pairs on each warm chat and dashboard route; repository headless Chromium, Team-scale synthetic fixture, live-fast latency, unprofiled. Both variants use current main's frozen warm-state harness. The HTTP/WS boundary is the benchmark's synthetic Gateway fixture. No local timings are performance evidence.

Median, baseline → candidate Chat Dashboard
Later structural frames 3 → 1 7 → 5
Cached-row positive growth (px) 57.94 → 0.00 95.59 → 63.59
First painted rows (ms) 580 → 608 564 → 580
Final rows (ms) 1025.8 → 814.6 1344.5 → 1349.1
Hello handled (ms) 563.8 → 563.6 570.7 → 573.2
FCP (ms) 88 → 92 92 → 92
LoAF blocking (ms) 189 → 200 142 → 141
CLS 0.21206 → 0.13392 0.03120 → 0.03521
Snapshot bytes 39095 → 48510 39095 → 48510

The primary improves in 10/11 chat pairs and 10/11 dashboard pairs; dashboard cached-row growth improves in 11/11. The full-thread proxy includes virtual spacers and expansion beyond the cached window, so it is reported separately rather than attributed solely to in-row facts.

Validation and CI

All seven regressions failed on their intended assertions against the baseline owners: reactions, bounded snapshot facts, frame first commit, activity, failure notice, metadata, and preserved activity spacing. 20/20 focused files and 11/11 native UI e2e files pass on measured head fe3e802f, including changed-while-away reactions, resolved notice, streaming reload, widget retention/custody, snapshot-route, dashboard, and Team-scale reload. Both builds and the bundle budget pass; startup gzip +80 B and chat boot +3,107 B, with unchanged request counts.

Independent review of the current head 66e86608f6cad258eb0981e1b8cad67435a4a886 is scoped-clean through P2. Exact-head CI completed: 41 jobs passed, 25 skipped; only check-lint and its aggregate gate failed. Every selected UI e2e shard passes. The lint failure is solely the explicitly approved one-entry untrack allowance (chat-agent-run-frame.tsx: 1 > 0); the immutable-base checker has no approval-registration input. This PR is ready and conflict-free, but CI is not green. The lead must resolve how that approval is recorded before landing.

The completed performance/focused/full-suite evidence below belongs to measured head fe3e802f. The required conflict rebase leaves every touched production file byte-identical; the one affected test file passes 2/2 afterward. The full suite and monolithic changed-check have not been repeated after that mechanical rebase.

The full UI suite completed on the final AWS lease: 841 files passed, 1 failed, 4 skipped; 3,210 tests passed, 1 failed, 4 skipped (5,143.13 s). Command: node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts. The sole failure is extensions/qa-lab/src/control-ui-automation-management.real-gateway.e2e.test.ts, case “configured owners and admin chat manage a Telegram-created job while a non-owner cannot”: Private mutation boundary is writable by another POSIX principal. It fails during fixture creation, before the scenario reaches the UI. Its main control remains unverified, so this is not claimed as an inherited failure.

The four opt-in/live skipped files are desktop-resize.real-gateway.e2e.test.ts, peer-followup-restart.real-gateway.e2e.test.ts, chat-steer-deferred-custody.real-gateway.e2e.test.ts, and deepseek-search.real-gateway.e2e.test.ts. The ordinary native deferred-custody suite passed in the 11-file focused e2e run.

corepack pnpm check:changed --base 54408a978fc91fd20130b6f904534b47c8dfe25a completed with exit 137 (1,253.88 s). Core-test, UI, and script typechecks pass, as do formatting and the ordinary source guards. Remaining failures: the approved one-entry controller ratchet; dead-export census (39 full-tree exports, main comparison unverified); and monolithic core lint terminated with exit 137. Kernel evidence was unavailable, so this is not diagnosed as OOM. CI's separately split core lint passes. No guard, permission boundary, or assertion was weakened.

Measured-head CI run completed red for two reasons:

  • The shrink-only guard rejects the explicitly approved one-entry untrack growth (chat-agent-run-frame.tsx: 1 > 0). Formatting, styles, i18n, and script lint pass. The checker compares with the immutable baseline and has no approval-registration input; recording the approved allowance remains a maintainer-owned landing requirement and the same sole rejection is confirmed on current-head CI.
  • UI e2e shard 5 exceeded the 120-second cold CLI preparation timeout in stale-build-recovery.production.e2e.test.ts, before its test body. The same test passes on the measured head in the full suite, including real-Gateway reload/reconnect. The CI job reported four CPUs and about 15 GiB despite its 16-class runner label. A matching cold main control was prepared, but has not run. Current-head UI shard 5 passes; no targeted fix or inherited-failure claim is made for the earlier timeout.

Remaining main controls were blocked by remote capacity: the first fresh-PR attempt failed broker readiness; after a successful diagnostic, the next request substituted a t3.small for the requested c7a.4xlarge because of AWS quota pressure. That lease was stopped before validation. No measurements from it are used. The completed performance comparison and focused/full-suite evidence all remain tied to the actual 16-CPU, 32-GiB final lease above. Ready for maintainer review, not green for landing; stop before merge.

Production LOC and scope

Required filter (git diff --stat origin/main...HEAD -- ':!*.test.ts' ':!*test-support*' ':!docs/*'): 594 added / 157 deleted, net +437, 30 files. This includes benchmark instrumentation, fixtures, and .test.tsx files. Handwritten UI runtime: +119. Growth supplies the missing bounded cache/hydration contract; generated validators and boot grouping carry that contract. The delayed notice/frame paths and the preload experiment are removed.

Touched owners: transcript memory/disk cache, reaction hydration and persistence, retained run frames, notice/activity rendering, metadata projection, spacing CSS, generated validators/boot grouping, associated tests, and opt-in Team-scale instrumentation. No virtualizer, footprint/geometry, pane chrome, sidebar, avatar, subscription/cursor, protocol, or server-state owner changes.

Focused commands and wall times

Commands are corepack pnpm test <file> --maxWorkers=1 on the final AWS lease.

File Wall time Result
ui/src/e2e/chat-agent-run-transcript.e2e.test.ts 26.22 s Pass
ui/src/e2e/chat-flow.reactions.e2e.test.ts 24.56 s Pass
ui/src/e2e/chat-native-turn-activity.e2e.test.ts 23.31 s Pass
ui/src/e2e/chat-retry-failure.e2e.test.ts 29.05 s Pass
ui/src/e2e/chat-snapshot-route.e2e.test.ts 54.15 s Pass
ui/src/e2e/chat-steer-deferred-custody.e2e.test.ts 23.10 s Pass
ui/src/e2e/chat-video-gallery.e2e.test.ts 27.23 s Pass
ui/src/e2e/chat-widget-retention.e2e.test.ts 25.49 s Pass
ui/src/e2e/chat-worked-for-visualization.e2e.test.ts 28.40 s Pass
ui/src/e2e/dashboard-cold-load.e2e.test.ts 28.43 s Pass
ui/src/e2e/team-scale-cold-load.e2e.test.ts 27.75 s Pass
ui/src/pages/chat/chat-pane-reactions.test.ts 5.56 s Pass
ui/src/pages/chat/chat-pane-offline-metadata.test.ts 7.54 s Pass
ui/src/lib/protocol-validators.generated.test.ts 4.16 s Pass
ui/src/pages/chat/components/chat-run-failure-notice.test.ts 4.69 s Pass
ui/src/pages/chat/components/chat-activity-disclosure.test.ts 5.21 s Pass
ui/src/pages/chat/components/chat-message-entry.test.ts 5.82 s Pass
ui/src/pages/chat/components/chat-message.test.tsx 5.74 s Pass
ui/src/pages/chat/components/chat-message-group.solid.test.tsx 5.41 s Pass
ui/src/pages/chat/components/chat-transcript-render.test.ts 6.90 s Pass
ui/src/pages/chat/components/chat-transcript-lazy-rows.test.tsx 5.32 s Pass
ui/src/pages/chat/components/chat-divider.browser.test.tsx 4.38 s Pass
ui/src/pages/chat/chat-history-warm-startup.test.ts 6.01 s Pass
ui/src/test-helpers/control-ui-team-scale-fixture.test.ts 4.39 s Pass
ui/src/pages/chat/components/chat-transcript-invalidation.test.ts 9.16 s Pass
ui/src/test-helpers/control-ui-e2e.sessions.test.ts 4.25 s Pass
ui/src/pages/chat/session-message-cache.test.ts 4.46 s Pass
ui/src/pages/chat/session-snapshot-store.test.ts 4.51 s Pass
ui/src/pages/chat/session-snapshot-write.test.ts 4.12 s Pass
ui/src/pages/chat/chat-pane-snapshot-hydration.test.ts 6.21 s Pass
ui/src/pages/chat/chat-pane-session-hydration.test.ts 5.49 s Pass
Complete IQRs and every paired delta

chat

Primary candidate counts: {'structural_at_most_one': 10, 'no_cached_row_growth': 11, 'no_same_membership_thread_growth': 0}

Metric Base median [IQR] Candidate median [IQR] Paired median delta Better/worse
structural_frames 3.0000 [3.0000, 3.0000] 1.0000 [1.0000, 1.0000] -2.0000 10/0
cached_row_growth_px 57.9375 [57.9375, 57.9375] 0.0000 [0.0000, 0.0000] -57.9375 10/0
thread_same_membership_growth_px 32.5938 [32.2969, 9536.2969] 19110.5938 [19110.5938, 19110.5938] +19078.0000 1/10
thread_membership_growth_px 19097.9375 [9594.2344, 19132.9375] 0.0000 [0.0000, 0.0000] -19097.9375 11/0
thread_total_growth_px 19130.5312 [19130.5312, 19199.9375] 19110.5938 [19110.5938, 19110.5938] -19.9375 11/0
thread_net_growth_px 19130.5312 [19130.5312, 19130.5312] 19110.5938 [19110.5938, 19110.5938] -19.9375 11/0
thread_max_growth_from_first_px 19130.5312 [19130.5312, 19167.9375] 19110.5938 [19110.5938, 19110.5938] -19.9375 11/0
thread_initial_height_px 10084.0000 [10084.0000, 10084.0000] 10107.3750 [10107.3750, 10107.3750] +23.3750 0/11
thread_final_height_px 29214.5312 [29214.5312, 29214.5312] 29217.9688 [29217.9688, 29217.9688] +3.4375 0/11
hello_handled_ms 563.8000 [562.7000, 567.2500] 563.6000 [562.6500, 566.0500] +1.0000 4/7
hello_listener_ms 563.6000 [562.6000, 567.0500] 563.4000 [562.5000, 565.9000] +0.9000 4/7
fcp_ms 88.0000 [88.0000, 96.0000] 92.0000 [92.0000, 96.0000] +4.0000 2/7
first_painted_rows_ms 580.0000 [580.0000, 584.0000] 608.0000 [608.0000, 612.0000] +28.0000 0/11
final_rows_ms 1025.8000 [1012.7500, 1060.1500] 814.6000 [804.0500, 821.9500] -211.4000 11/0
final_row_membership_ms 1025.8000 [1012.7500, 1060.1500] 533.3000 [532.7500, 536.9000] -492.9000 11/0
final_in_row_facts_ms 812.4000 [795.7000, 819.7000] 814.6000 [804.0500, 821.9500] +0.3000 4/7
loaf_blocking_ms 189.0000 [179.5000, 198.0000] 200.0000 [187.0000, 229.5000] +15.0000 5/6
loaf_duration_ms 1122.0000 [1034.0000, 1207.0000] 1209.0000 [1103.5000, 1284.5000] +17.0000 5/6
cls 0.2121 [0.1826, 0.2121] 0.1339 [0.1339, 0.1838] -0.0487 10/1
snapshot_bytes 39095.0000 [39095.0000, 39095.0000] 48510.0000 [48510.0000, 48510.0000] +9415.0000 0/11

Every paired delta

Pair structural_frames cached_row_growth_px thread_same_membership_growth_px thread_membership_growth_px thread_total_growth_px thread_net_growth_px thread_max_growth_from_first_px thread_initial_height_px thread_final_height_px hello_handled_ms hello_listener_ms fcp_ms first_painted_rows_ms final_rows_ms final_row_membership_ms final_in_row_facts_ms loaf_blocking_ms loaf_duration_ms cls snapshot_bytes
1 -2.0000 -57.9375 +19078.5938 -19167.9375 -89.3438 -19.9375 -57.3438 +23.3750 +3.4375 -2.8000 -2.7000 +8.0000 +32.0000 -155.8000 -439.6000 +72.3000 -3.0000 -21.0000 +0.0012 +9415.0000
2 -2.0000 -57.9375 +19078.0000 -19097.9375 -19.9375 -19.9375 -19.9375 +23.3750 +3.4375 -2.3000 -2.4000 +4.0000 +28.0000 -211.7000 -493.7000 +2.2000 -22.0000 -34.0000 -0.0283 +9415.0000
3 -1.0000 -57.9375 +19078.0000 -19097.9375 -19.9375 -19.9375 -19.9375 +23.3750 +3.4375 +4.8000 +4.9000 +4.0000 +24.0000 -72.6000 -478.9000 +130.2000 +79.0000 +479.0000 -0.0781 +9415.0000
4 -2.0000 -57.9375 +19078.0000 -19097.9375 -19.9375 -19.9375 -19.9375 +23.3750 +3.4375 +1.7000 +1.7000 +4.0000 +32.0000 -216.9000 -504.5000 +0.3000 +57.0000 +71.0000 -0.0283 +9415.0000
5 -2.0000 -57.9375 +19078.0000 -19097.9375 -19.9375 -19.9375 -19.9375 +23.3750 +3.4375 -1.9000 -1.9000 +8.0000 +32.0000 -210.8000 -492.9000 +0.3000 +20.0000 -82.0000 -0.0283 +9415.0000
6 -2.0000 -57.9375 +19078.5938 -19167.9375 -89.3438 -19.9375 -57.3438 +23.3750 +3.4375 +0.6000 +0.5000 +0.0000 +28.0000 -207.3000 -479.8000 +21.7000 -3.0000 -98.0000 -0.0487 +9415.0000
7 -3.0000 -57.9375 +12.6562 -32.5938 -19.9375 -19.9375 -19.9375 +23.3750 +3.4375 +1.7000 +1.7000 +0.0000 +28.0000 -260.7000 -544.5000 -132.3000 +15.0000 +163.0000 -0.0781 +9415.0000
8 -3.0000 -57.9375 -89.3438 -0.5938 -89.9375 -19.9375 -57.3438 +23.3750 +3.4375 -11.0000 -10.8000 -4.0000 +24.0000 -467.7000 -702.9000 -250.9000 -52.0000 -109.0000 -0.0487 +9415.0000
9 -2.0000 -57.9375 +19078.0000 -19097.9375 -19.9375 -19.9375 -19.9375 +23.3750 +3.4375 +1.0000 +0.9000 -4.0000 +28.0000 -206.1000 -451.7000 -34.4000 -11.0000 +214.0000 -0.0781 +9415.0000
10 +0.0000 +0.0000 +70.5938 -90.5312 -19.9375 -19.9375 -19.9375 +23.3750 +3.4375 +5.8000 +5.7000 +4.0000 +28.0000 -275.4000 -545.2000 -5.0000 +28.0000 +154.0000 -0.0770 +9415.0000
11 -2.0000 -57.9375 +19078.5938 -19167.9375 -89.3438 -19.9375 -57.3438 +23.3750 +3.4375 +14.2000 +14.1000 +8.0000 +40.0000 -211.4000 -465.7000 +25.7000 +25.0000 +17.0000 -0.0487 +9415.0000

Accepted costs and paired-rule assessment are stated above.

dashboard

Primary candidate counts: {'structural_at_most_one': 0, 'no_cached_row_growth': 0, 'no_same_membership_thread_growth': 0}

Metric Base median [IQR] Candidate median [IQR] Paired median delta Better/worse
structural_frames 7.0000 [5.5000, 7.5000] 5.0000 [4.0000, 5.0000] -2.0000 10/1
cached_row_growth_px 95.5938 [95.5938, 124.5625] 63.5938 [63.5938, 63.5938] -32.0000 11/0
thread_same_membership_growth_px 19397.5156 [9759.2344, 19397.5156] 19276.5781 [19276.5781, 19276.5781] -120.9375 8/3
thread_membership_growth_px 32.0000 [32.0000, 9670.2891] 63.0000 [63.0000, 63.0000] +31.0000 3/8
thread_total_growth_px 19429.5156 [19429.5156, 19429.5156] 19339.5781 [19339.5781, 19339.5781] -89.9375 11/0
thread_net_growth_px 19429.5156 [19429.5156, 19429.5156] 19339.5781 [19339.5781, 19339.5781] -89.9375 11/0
thread_max_growth_from_first_px 19429.5156 [19429.5156, 19429.5156] 19339.5781 [19339.5781, 19339.5781] -89.9375 11/0
thread_initial_height_px 10206.4375 [10206.4375, 10206.4375] 10296.3750 [10296.3750, 10296.3750] +89.9375 0/11
thread_final_height_px 29635.9531 [29635.9531, 29635.9531] 29635.9531 [29635.9531, 29635.9531] +0.0000 1/0
hello_handled_ms 570.7000 [565.2000, 602.5500] 573.2000 [566.1000, 576.9000] +0.2000 5/6
hello_listener_ms 570.6000 [565.1500, 602.3000] 573.0000 [565.9000, 576.6500] +0.2000 5/6
fcp_ms 92.0000 [88.0000, 92.0000] 92.0000 [90.0000, 96.0000] +4.0000 3/6
first_painted_rows_ms 564.0000 [556.0000, 590.0000] 580.0000 [576.0000, 584.0000] +20.0000 3/8
final_rows_ms 1344.5000 [1313.4000, 1390.1000] 1349.1000 [1295.1000, 1362.6000] -46.9000 7/4
final_row_membership_ms 1014.9000 [1005.7500, 1040.3500] 680.0000 [671.5500, 703.7500] -341.2000 11/0
final_in_row_facts_ms 1344.5000 [1313.4000, 1390.1000] 1349.1000 [1295.1000, 1362.6000] -46.9000 7/4
loaf_blocking_ms 142.0000 [113.5000, 168.5000] 141.0000 [124.0000, 162.5000] -3.0000 6/5
loaf_duration_ms 886.0000 [799.5000, 907.0000] 851.0000 [786.0000, 892.0000] -46.0000 7/4
cls 0.0312 [0.0305, 0.0314] 0.0352 [0.0352, 0.0356] +0.0042 0/11
snapshot_bytes 39095.0000 [39095.0000, 39095.0000] 48510.0000 [48510.0000, 48510.0000] +9415.0000 0/11

Every paired delta

Pair structural_frames cached_row_growth_px thread_same_membership_growth_px thread_membership_growth_px thread_total_growth_px thread_net_growth_px thread_max_growth_from_first_px thread_initial_height_px thread_final_height_px hello_handled_ms hello_listener_ms fcp_ms first_painted_rows_ms final_rows_ms final_row_membership_ms final_in_row_facts_ms loaf_blocking_ms loaf_duration_ms cls snapshot_bytes
1 +1.0000 -32.0000 +19155.6250 -19245.5781 -89.9531 -89.9375 -89.9375 +89.9375 +0.0000 -57.3000 -57.2000 +4.0000 -40.0000 -73.3000 -343.6000 -73.3000 -70.0000 -119.0000 +0.0227 +9415.0000
2 -2.0000 -32.0000 -120.9375 +31.0000 -89.9375 -89.9375 -89.9375 +89.9375 +0.0000 +0.2000 +0.2000 +12.0000 +12.0000 -46.9000 -362.7000 -46.9000 +18.0000 +9.0000 +0.0042 +9415.0000
3 -2.0000 -89.9375 +19155.6406 -19245.5781 -89.9375 -89.9375 -89.9375 +89.9375 +0.0000 +5.6000 +5.6000 +0.0000 +20.0000 +51.6000 -341.2000 +51.6000 -3.0000 -57.0000 +0.0044 +9415.0000
4 -4.0000 -89.9375 -120.9375 +31.0000 -89.9375 -89.9375 -89.9375 +89.9375 +0.0000 -7.7000 -7.8000 -8.0000 +20.0000 -61.2000 -336.8000 -61.2000 +65.0000 -46.0000 +0.0034 +9415.0000
5 -1.0000 -31.4062 -120.9375 +31.0000 -89.9375 -89.9375 -89.9375 +89.9375 +0.0000 -61.5000 -61.6000 -8.0000 -40.0000 -109.7000 -331.6000 -109.7000 -12.0000 -63.0000 +0.0044 +9415.0000
6 -1.0000 -32.0000 +19155.6406 -19245.5781 -89.9375 -89.9375 -89.9375 +89.9375 +0.0000 -15.1000 -15.1000 +4.0000 +12.0000 +55.2000 -345.2000 +55.2000 -42.0000 -185.0000 +0.0053 +9415.0000
7 -4.0000 -89.9375 -120.9375 +31.0000 -89.9375 -89.9375 -89.9375 +89.9375 +0.0000 +20.9000 +20.8000 +4.0000 +24.0000 +66.2000 -222.7000 +66.2000 +33.0000 +69.0000 +0.0034 +9415.0000
8 -3.0000 -32.0000 -120.9375 +31.0000 -89.9375 -89.9375 -89.9375 +89.9375 +0.0000 +4.6000 +4.4000 +4.0000 +20.0000 -29.1000 -379.1000 -29.1000 -58.0000 -97.0000 +0.0042 +9415.0000
9 -2.0000 -32.0000 -120.9375 +31.0000 -89.9375 -89.9375 -89.9375 +89.9375 +0.0000 +26.1000 +26.1000 +12.0000 +44.0000 -234.6000 -305.8000 -234.6000 +38.0000 +129.0000 +0.0042 +9415.0000
10 -1.0000 -31.4062 -120.9531 +31.0000 -89.9531 -89.9531 -89.9531 +89.9375 -0.0156 -186.6000 -186.6000 -4.0000 -100.0000 -162.5000 -467.6000 -162.5000 -20.0000 -17.0000 +0.0060 +9415.0000
11 -2.0000 -32.0000 -120.9375 +31.0000 -89.9375 -89.9375 -89.9375 +89.9375 +0.0000 +9.8000 +9.8000 +0.0000 +20.0000 +28.6000 -321.4000 +28.6000 +18.0000 +71.0000 +0.0038 +9415.0000

Accepted costs and paired-rule assessment are stated above.

Synthetic before/after

Separate filmstrip-only captures, not timing samples. First cached compositor frames: baseline +616 ms / candidate +664 ms, selected at or after each variant's first-row paint. The baseline still has loading content where the candidate already has its cached notice and reactions.

First cached rows: before First cached rows: after
Synthetic first cached rows before Synthetic first cached rows after
Settled chat: before Settled chat: after
Synthetic chat before Synthetic chat after
Settled dashboard: before Settled dashboard: after
Synthetic dashboard before Synthetic dashboard after

All captures were inspected in full and contain synthetic fixture data only. Stop before merge; the campaign lead owns landing.

@clawsweeper

clawsweeper Bot commented Oct 26, 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 26, 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-26T12:00:59.078802Z 66e8660 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 26, 2026
@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 26, 2026
@clawsweeper

clawsweeper Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR restores cached reactions, context metadata, activity summaries, failure notices, and run bodies together with transcript rows.

Example: Reload a saved conversation containing 80 cached messages and a 👍 reaction.

  • Before: Cached rows appear before their reactions and other content, causing later growth.
  • After: Cached facts render with their rows and reconcile with authoritative Gateway results.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The measured improvement and accepted tradeoffs support the direction, but a layout regression and failing regression scenarios prevent a clean verdict.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its body reports Chromium reload measurements against a synthetic Gateway, while the inspected images belong to the linked sidebar precedent.
Patch quality 🦪 silver shellfish (2/6) 5 actionable review findings remain.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Saved conversations visibly grow as reactions, summaries, notices, and run bodies arrive after their cached rows.
Reason: The maintainer-directed change addresses measured reload instability using existing owners, with its performance costs explicitly accepted.

Merge readiness

⛔ Blocked before merge - 6 items remain

Keep this useful, owner-directed PR open; the frame wrapper breaks transcript spacing, and four test-path defects need repair before merge.

Priority: P2
Reviewed head: b0a8611265f534143be485e3b9f261637202bf8c

Before merge

  • Preserve run-block spacing through the new frame wrapper (P2) - The added div becomes the parent of run bubbles, activity groups, and work summaries. Existing selectors in grouped.css:86–106 require those elements to be direct children of .chat-group-messages; display: contents changes layout boxes but does not remove the DOM ancestor. A run containing a work summary followed by its answer therefore loses its boundary margin. Preserve the former ancestry or update the spacing owner for the wrapper and verify computed gaps.
  • Update the warm-startup fixture to the admitted snapshot version (P2) - The production reader now rejects projection version 3, but snapshotRecord in chat-history-warm-startup.test.ts:200–207 still emits it. Those tests consequently exercise cache rejection instead of restoration: exact-head checks-ui (3/3) reports missing widget heights and missing stored cursor/knownState. Update that fixture to version 4 while retaining an explicit old-version rejection case.
  • Scope reload assertions to visible transcript content (P2) - The new answer selector matches both the visible paragraph and the live-region announcement, so Playwright throws a strict-mode violation before the failure-removal assertion runs. Exact-head CI reports the same collision for Draft after reload at line 162. Scope these selectors and subsequent streaming assertions to their transcript message content so both new scenarios can reach their intended assertions.
  • Await lazy notice content before querying it synchronously (P2) - ChatNotice now loads ordinary notice details lazily, but view.getByText(label) executes synchronously before expect.element can retry. Exact-head checks-ui (2/3) fails with an empty container at this line. Await findByText or use a retryable browser locator before reading the details elements.
  • Disable subscription history when holding chat.startup (P2) - This new scenario waits for a standalone chat.startup request, but installMockGateway defaults subscriptionInitialHistory to true and returns history in sessions.messages.subscribe. The standalone request never occurs, and exact-head checks-ui-e2e (3/7) times out at line 31. Set subscriptionInitialHistory: false, as the adjacent new transcript scenarios do, or hold and resolve the actual subscription history boundary.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

  • [P2] Preserve run-block spacing through the new frame wrapper — ui/src/pages/chat/components/chat-agent-run-frame.tsx:81-82
  • [P2] Update the warm-startup fixture to the admitted snapshot version — ui/src/pages/chat/session-snapshot-store.ts:51
  • [P2] Scope reload assertions to visible transcript content — ui/src/e2e/chat-agent-run-transcript.e2e.test.ts:111

Tests

  • Missing end-to-end proof: The supplied evidence does not show a latest-stable upgrade preserving settings and authoritative data while retiring old disposable snapshots.
Agent review details

How this fits together

The Control UI snapshot and reaction owners turn scoped browser cache records and Gateway updates into retained transcript rows.

flowchart LR
  A[Gateway history and reactions] --> B[Chat pane owners]
  B --> C[Scoped memory snapshot]
  C --> D[Bounded browser storage]
  D --> B
  B --> E[Transcript projection]
  E --> F[Retained Solid rows]
Loading

Technical review

Best possible solution:

Retain the existing snapshot and reaction owners while preserving frame spacing and repairing the affected reload tests.

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

Current-main source separates cached rows from delayed frame content and lacks persisted reaction summaries; the body reports baseline-red regressions and paired browser measurements.

Is this the best way to solve the issue?

Reusing bounded snapshots and existing reaction authority is appropriate, and the failed preload experiment was removed; the new DOM wrapper must preserve the existing spacing contract.

Full review comments:

  • [P2] Preserve run-block spacing through the new frame wrapper — ui/src/pages/chat/components/chat-agent-run-frame.tsx:81-82
    The added div becomes the parent of run bubbles, activity groups, and work summaries. Existing selectors in grouped.css:86–106 require those elements to be direct children of .chat-group-messages; display: contents changes layout boxes but does not remove the DOM ancestor. A run containing a work summary followed by its answer therefore loses its boundary margin. Preserve the former ancestry or update the spacing owner for the wrapper and verify computed gaps.
    Confidence: 0.98
  • [P2] Update the warm-startup fixture to the admitted snapshot version — ui/src/pages/chat/session-snapshot-store.ts:51
    The production reader now rejects projection version 3, but snapshotRecord in chat-history-warm-startup.test.ts:200–207 still emits it. Those tests consequently exercise cache rejection instead of restoration: exact-head checks-ui (3/3) reports missing widget heights and missing stored cursor/knownState. Update that fixture to version 4 while retaining an explicit old-version rejection case.
    Confidence: 1
  • [P2] Scope reload assertions to visible transcript content — ui/src/e2e/chat-agent-run-transcript.e2e.test.ts:111
    The new answer selector matches both the visible paragraph and the live-region announcement, so Playwright throws a strict-mode violation before the failure-removal assertion runs. Exact-head CI reports the same collision for Draft after reload at line 162. Scope these selectors and subsequent streaming assertions to their transcript message content so both new scenarios can reach their intended assertions.
    Confidence: 1
  • [P2] Await lazy notice content before querying it synchronously — ui/src/pages/chat/components/chat-divider.browser.test.tsx:51
    ChatNotice now loads ordinary notice details lazily, but view.getByText(label) executes synchronously before expect.element can retry. Exact-head checks-ui (2/3) fails with an empty container at this line. Await findByText or use a retryable browser locator before reading the details elements.
    Confidence: 1
  • [P2] Disable subscription history when holding chat.startup — ui/src/e2e/chat-flow.reactions.e2e.test.ts:25-26
    This new scenario waits for a standalone chat.startup request, but installMockGateway defaults subscriptionInitialHistory to true and returns history in sessions.messages.subscribe. The standalone request never occurs, and exact-head checks-ui-e2e (3/7) times out at line 31. Set subscriptionInitialHistory: false, as the adjacent new transcript scenarios do, or hold and resolve the actual subscription history boundary.
    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 9e173826901b.

Provenance checked

  • Snapshot persistence and bounded projection keeps the original intent (0e7f8c9: Persist scoped transcripts for immediate restoration; subsequent bounded-snapshot work retained recent rows and authoritative refill behavior.)
  • Reaction-read timing changes intended behavior with a stated reason (f20e7db: Defer reaction reads until transcript paint to reduce startup work; this PR deliberately starts reconciliation earlier so restored reactions do not lag their rows.)
  • Lazy activity and notice rendering changes intended behavior with a stated reason (c2d4264: Keep optional transcript code off cold chat boot; this PR retains eager row facts after a measured preload comparison and records accepted first-row costs.)
  • Retained frame ranges keeps the original intent (5dd456a: Preserve widget iframe ancestry and owner-controlled disposal during Solid reconciliation; synchronous initialization retains that owner but introduces the spacing defect listed below.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • node scripts/run-vitest.mjs ui/src/pages/chat/chat-history-warm-startup.test.ts --maxWorkers=1
  • node scripts/run-vitest.mjs ui/src/pages/chat/components/chat-divider.browser.test.tsx --maxWorkers=1
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts ui/src/e2e/chat-agent-run-transcript.e2e.test.ts ui/src/e2e/chat-flow.reactions.e2e.test.ts --maxWorkers=1
  • pnpm check:changed
  • Inspect computed work/activity/bubble gaps and sanitized before/after screenshots.

What I checked:

  • Pinned change and current-main comparison: Reviewed the introduced merge-base-to-head hunks; fetched main still uses projection version 3 and delayed frame-body initialization. (ui/src/pages/chat/components/chat-agent-run-frame.tsx:81, b0a8611265f5)
  • Spacing contract: Run content mounts inside .chat-group-messages; its existing direct-child selectors apply margins between work summaries, activity, and bubbles, but cannot match through the added div. (ui/src/styles/chat/grouped.css:94, b0a8611265f5)
  • Observed test failures: Exact-head CI reports stale-version snapshot failures, strict text-selector collisions in both new transcript reload tests, a synchronous query failure in the notice browser test, and a timeout waiting for chat.startup in the new reaction test. (ui/src/e2e/chat-agent-run-transcript.e2e.test.ts:111, b0a8611265f5)
  • Accepted performance tradeoffs: The maintainer-authored body explicitly accepts later first rows, increased snapshot size, dashboard CLS cost, and the single initial-sampling untrack allowance; these require no renewed direction approval. (b0a8611265f5)
  • Supplied media attribution: Both downloaded images were inspected and show sidebar reload filmstrips from fix(control-ui): keep sidebar rows steady through reload #180569; they establish that precedent rather than this PR's changed transcript behavior. (c44496a0cb48)
  • Feature history and ownership: Scoped history across current and earlier cache paths identifies Peter Steinberger as the principal snapshot, reaction, and retained-frame contributor, with earlier cache work shared with Shakker. (ui/src/pages/chat/session-message-cache.ts:306, 9e173826901b)

Likely related people:

  • Shakker: Raw commit cf45dcd adds ui/src/pages/chat/session-message-cache.ts:148 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: cf45dcd07e51; files: ui/src/pages/chat/session-message-cache.ts)

PR surface

Source +175, Tests +393, Generated +1, Other +156. Total +725 across 39 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 18 311 136 +175
Tests 15 408 15 +393
Docs 0 0 0 0
Config 0 0 0 0
Generated 1 3 2 +1
Other 5 159 3 +156
Total 39 881 156 +725

Review metrics

Metric Value Why it matters
Benchmark option 1 new flag: --row-facts Opt-in measurement instrumentation; it adds no user-facing runtime setting.
Persisted snapshot version 3 → 4 Existing transcript cache records are rejected and refilled; authoritative server storage is unchanged.

Labels

Label changes:

  • add P2: This improves reload stability on an established UI surface, with limited-impact spacing and validation defects to repair.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp 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 improves reload stability on an established UI surface, with limited-impact spacing and validation defects to repair.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp 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 26, 2026, 3:28 AM ET / 07:28 UTC.

@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: b0a8611265

ℹ️ 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 +81 to +82
const parent = document.createElement("div");
parent.style.display = "contents";

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 Preserve run-block spacing when adding the body wrapper

For run frames containing tool/work activity followed by an assistant reply, this wrapper stops the spacing selectors in ui/src/styles/chat/grouped.css:86–107 from matching. Those rules require bubbles, activity groups, and work groups to be direct children of .chat-group-messages; display: contents removes the wrapper's layout box but does not remove it from CSS ancestry. Consequently, these frames lose their existing message-type and run-block separation. Keep the original DOM relationship or update the affected selectors alongside the wrapper.

Useful? React with 👍 / 👎.

@steipete
steipete force-pushed the steipete/coldload-cached-row-facts branch from b0a8611 to fe3e802 Compare October 26, 2026 09:27
@steipete

Copy link
Copy Markdown
Contributor Author

The run-body spacing finding is fixed on fe3e802f640a63bf5f4e734d58fa84425095c856: the existing spacing selectors now include the retained body wrapper, with a regression that fails against the original CSS and passes on this head. Independent review is clean through P2; all 20 focused and 11 native e2e files pass.

The PR body now contains final 11-pair-per-route measurements, the accepted tradeoffs, inspected synthetic screenshots, full-suite results, and explicit remaining CI/validation gaps. The approved single-entry untrack ratchet still requires maintainer handling; the cold-build and QA fixture failures are not claimed as inherited because valid main controls were blocked by remote capacity. No merge is requested.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

Retain scoped reaction summaries and context-window metadata in the disposable transcript snapshot. Publish retained frame bodies and lightweight notice/activity content with their rows, then reconcile live facts in place. Add opt-in cold-load row-fact measurements and reload regressions.
@steipete
steipete force-pushed the steipete/coldload-cached-row-facts branch from fe3e802 to 66e8660 Compare October 26, 2026 11:53
@steipete

Copy link
Copy Markdown
Contributor Author

Final head: 66e86608f6cad258eb0981e1b8cad67435a4a886, conflict-free after rebasing on main. The only touched-file rebase difference is main's test-helper cleanup; every touched production file remains byte-identical to the measured version. The affected test passes 2/2, and fresh independent review of this head is clean through P2.

Exact-head CI completed: all selected UI e2e shards pass, including the previously timed-out stale-build recovery scenario. The sole failed check is the expressly approved one-entry untrack allowance, plus its aggregate gate. The final body records the full-suite/changed-check failures and the blocked main controls without claiming they are inherited. All owned AWS leases are released. No merge performed or requested.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete merged commit 09e552f into main Oct 26, 2026
122 of 125 checks passed
@steipete
steipete deleted the steipete/coldload-cached-row-facts branch October 26, 2026 12:22
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 27, 2026
…penclaw#184334)

Peter asked to store more data offline so warm reloads don't visibly load. Cached transcript rows painted first and then grew as reactions, failure notices, activity groups and run-frame content arrived after the transcript became ready. Reaction summaries were not in the transcript snapshot, and run frames published their retained child ranges only after the frame shell settled.

The disposable, bounded transcript snapshot now also persists reaction summaries (server facts only, same session incarnation) and the context-window size. Cached rows render reactions, failure notices, activity groups, metadata and run-frame child ranges in the row's first commit. Live reads reconcile in place, and run-frame widget custody is unchanged.

Evidence, 11 interleaved AWS pairs per route: chat later structural frames 3 -> 1, cached-row growth 58 -> 0 px, complete rows 1,026 -> 815 ms; dashboard frames 7 -> 5, growth 96 -> 64 px. 20 focused files and 11 native UI e2e files pass; full UI suite 841 passed, 1 unrelated QA-lab fixture failure.

Accepted tradeoff: first painted rows +28 ms chat / +16 ms dashboard, snapshot +9.4 KB, dashboard CLS +0.004 (precedent openclaw#180569). One new untrack allowance for the run-frame initial sample, approved by the maintainer (2026-10-25). The shrink-only controller ratchet has no approval input, so it is the only failing check. Runtime +119 LOC (handwritten).
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 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