Skip to content

perf(control-ui): paint cached context usage with the composer - #190824

Merged
steipete merged 6 commits into
mainfrom
steipete/coldload-context-ring-cached
Nov 2, 2026
Merged

steipete merged 6 commits into
mainfrom
steipete/coldload-context-ring-cached

Conversation

@steipete

@steipete steipete commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

A signed-in warm reload of an active chat or dashboard deep link omits the composer's context-usage ring until live usage arrives, then replays a 200ms mount fade. This is one late visible change in the campaign's measured 14-state dashboard reload waterfall.

The ring needs admitted totalTokens, freshness and the existing resolved context limit (last-prompt budget before reserve, otherwise contextTokens). Boot roster/transcript projections and the prior composer snapshot omit used tokens. The Gateway already validates the durable token-version stamp; the UI receives admitted totals/freshness, not that raw stamp.

Why This Change Was Made

Retain four display inputs in the existing scoped session snapshot: used tokens, resolved limit, approximate flag and last-prompt-budget flag. Partial roster rows preserve the last admitted display; explicit live unavailability clears it; complete live usage replaces it in the same ring element. Snapshot equality includes usage-only changes. Delete only the ring's mount fade and the context-budget helper's obsolete forced deferred-chunk assignment.

Data-model compatibility: optional sessionState.contextUsage stays within projection 14, following the optional nested-field pattern in #189769. Old records omit it and use live rendering; old readers ignore it inside the non-strict session-state object. Existing account/connection/session/incarnation invalidation and retention stay with the snapshot owner. Cached display inputs never seed the authority-bearing selected-session row. No new store, server schema, Gateway protocol or configuration option.

User Impact

Once usage has been admitted and saved, warm reload shows its final ring with the cached composer. Live changes update that control in place; an explicitly withdrawn measurement removes it and its high-context warning. Older snapshots acquire the optional field after live admission; cold loads still obtain usage live, with the decorative mount fade removed. Hover, color and popover motion remain.

Evidence

Exact chat boot budget, lead-approved 2026-11-02: CI's controlled build procedure on Node 24.22.1 measures current main at 1,278,887 B and the rebased candidate at 1,278,732 B (−155 B). The chat boot cap is set to exactly 1,278,732 B, with no added headroom; the existing 64 B build variance remains. Parallel campaign landings put main over the old 1,277,887 B cap; the original +500 B delta became −155 B after rebasing through #190925. No other budget is changed, and the comparison passes every budget.

Accepted performance comparison head d60a894a90f4718ae0102a9e836b0609b75a2256; pinned main baseline c9cd215bf94ffdb466ca32674ea3f305edfc1de3. One quiet AWS c7a.4xlarge, lease cbx_1752559ed9e8, run run_93479035d7a3c896cc1ca5bea183382d. Chromium 156.0.8078.4 from repo Playwright; native active-session/plugin fixture, 3,000 sessions, involving-me/category/created preferences, 97 groups/102 section-order entries, 5 collapsed groups, empty groups always, preview off and pinned sessions. Eleven interleaved AB/BA pairs plus eleven A/A pairs per route, unprofiled, 80 ms CDP latency; additional Team-scale live-fast eleven pairs per route. No local-host timings are performance results.

Primary gate passes: first-composer-rAF final value/opacity improves 0/11 → 11/11 on both routes. The first inspected FCP-correlated captured surface improves 1/11 → 11/11 on Chat and 0/11 → 11/11 on Dashboard: 10/11 and 11/11 paired improvements. All 22 candidate first ring crops are pixel-identical to their final crops; every first-rAF label is Session context usage: 1.8k of 96k (2%), opacity 1. All selected composer crops and all 88 first FCP-correlated full surfaces in A/B+A/A were inspected. Synthetic-only captures follow below.

Snapshot bytes Baseline Candidate Growth
Chat 113,119 113,205 +86 (0.0760%)
Dashboard 114,696 114,782 +86 (0.0750%)

No secondary crosses the campaign regression rule: all IQRs overlap and no adverse metric is worse in 9/11 pairs above the threshold. Chat CLS is higher in 7/11 pairs and is reported explicitly. This removes a visible state change; no overall timing win is claimed. Team-scale FCP medians are unchanged at 88 ms Chat / 92 ms Dashboard. The separate Team-scale run disables owner probes; native measurements own LoAF.

First-composer ring result

Primary captured surface: first inspected composer capture selected by the rig at/after loader-matched FCP. The independent first-rAF observation compares the aria label, SVG dial and opacity with the final value. Pixel comparison uses the unmodified ring crop against the final surface; every selected capture is inspected separately.

Route First-rAF baseline → candidate Captured-surface baseline → candidate Better captured pairs
chat 0/11 → 11/11 1/11 → 11/11 10/11
dashboard 0/11 → 11/11 0/11 → 11/11 11/11
Pair Chat baseline Chat candidate Dashboard baseline Dashboard candidate
1 absent/fading final absent/fading final
2 absent/fading final absent/fading final
3 absent/fading final absent/fading final
4 absent/fading final absent/fading final
5 absent/fading final absent/fading final
6 absent/fading final absent/fading final
7 final final absent/fading final
8 absent/fading final absent/fading final
9 absent/fading final absent/fading final
10 absent/fading final absent/fading final
11 absent/fading final absent/fading final

A/A captured-surface control (both arms run baseline code):

Route First arm Second arm
chat 1/11 0/11
dashboard 0/11 0/11

Capture-method qualification: the ring's first visible-composer rAF and the first inspected FCP-correlated captured surface are separate boundaries. Screencast frames carry no navigation loader ID. Earlier raw surfaces support the result but do not establish first actual new-document presentation.

Chromium 156.0.8078.4 builds screencast timestamps from the frame's expected-display reference (source); FCP uses compositor presentation feedback (source). Root personally inspected both source paths. The rig's FCP-correlated marker is conservative: an earlier captured surface can already contain the composer. Neither sparse captures nor DOM sampling prove every OS display vsync.

Native active-session reloads

11 interleaved pairs per route; fixed AWS c7a.4xlarge; 80 ms CDP latency profile; unprofiled; 91.7% CPU idle before capture. Values are medians [Q1, Q3], milliseconds except CLS. All IQRs overlap; no secondary meets the campaign regression rule. Chat CLS is higher in 7/11 pairs with overlapping IQRs; this does not cross the campaign regression rule. No overall timing win is claimed.

Route Metric Baseline Candidate Paired median delta Worse pairs A/A paired delta
chat Hello handled 583.9 [545.4, 602.4] 575.3 [549.6, 587.4] 15.0 6/11 -5.9 [-44.1, 36.3]
chat FCP 1310.2 [1261.6, 1335.5] 1279.8 [1224.7, 1307.1] -43.2 4/11 -6.6 [-51.9, 83.2]
chat First painted rows 1311.2 [1263.5, 1337.5] 1283.5 [1227.5, 1309.5] -44.2 4/11 -8.1 [-52.0, 82.1]
chat Final rows (DOM) 620.2 [597.8, 656.4] 625.7 [608.6, 635.6] -10.6 5/11 -20.4 [-41.6, -3.4]
chat LoAF blocking 448.6 [401.7, 457.5] 441.2 [412.5, 458.8] 7.6 6/11 -19.0 [-60.4, 10.8]
chat CLS 0.000446 [0.000446, 0.002474] 0.002697 [0.000874, 0.005029] 0.002251 7/11 0.000000 [-0.001659, 0.001125]
dashboard Hello handled 637.7 [602.5, 719.1] 694.8 [597.9, 805.1] 28.9 6/11 -80.8 [-166.3, 140.1]
dashboard FCP 1237.8 [1191.7, 1320.4] 1229.5 [1205.9, 1252.4] -5.8 5/11 -10.6 [-63.5, 63.5]
dashboard First painted rows 1239.5 [1193.5, 1321.5] 1231.5 [1209.4, 1253.4] -8.0 4/11 -12.0 [-62.0, 63.9]
dashboard Final rows (DOM) 649.6 [617.0, 676.3] 629.1 [587.0, 642.2] -21.3 2/11 20.0 [-2.1, 39.6]
dashboard LoAF blocking 393.7 [380.6, 423.5] 417.1 [354.5, 441.9] -9.9 5/11 24.7 [-35.9, 38.3]
dashboard CLS 0.000446 [0.000446, 0.000661] 0.000446 [0.000446, 0.001096] 0.000000 3/11 0.000000 [-0.000428, 0.000855]
chat FCP-correlated transcript surface* 1315.4 [1277.5, 1339.5] 1328.8 [1298.5, 1463.9] 75.6 7/11 37.2 [-27.6, 82.8]
dashboard FCP-correlated transcript surface* 1299.2 [1201.0, 1401.8] 1252.4 [1214.6, 1372.4] -26.5 5/11 -14.8 [-46.2, 6.2]
A/B per-pair deltas (second arm minus first)

chat

Pair Hello FCP First painted rows Final rows FCP-correlated transcript surface* LoAF CLS
1 119.5 -81.5 -79.8 3.5 198.1 -7.4 0.002332
2 -40.1 -95.8 -96.0 -26.1 -96.6 -53.7 0.002251
3 15.0 -43.2 -44.2 8.8 -40.0 34.5 0.002251
4 -8.6 -209.3 -208.1 -30.1 150.3 7.6 0.004583
5 38.2 -37.1 -35.9 42.0 251.9 60.8 0.004583
6 -67.3 -104.2 -104.0 -70.7 -90.2 -48.7 -0.002251
7 342.7 79.7 80.0 27.7 80.8 82.3 -0.004136
8 -44.4 48.5 47.9 -38.4 34.2 -46.7 0.002779
9 157.6 112.8 115.9 -31.1 107.2 67.4 -0.001395
10 -76.1 -189.4 -188.0 -10.6 -180.7 -53.8 0.004583
11 35.2 79.2 79.9 46.1 75.6 55.1 0.000000

dashboard

Pair Hello FCP First painted rows Final rows FCP-correlated transcript surface* LoAF CLS
1 113.2 -41.0 -40.1 -21.3 -42.4 -25.0 0.000036
2 -24.9 13.8 16.0 -4.0 15.8 -9.9 0.000000
3 113.7 -26.5 -24.1 -74.0 -28.5 58.5 0.000855
4 -279.6 6.3 8.0 67.2 17.0 -86.1 0.000000
5 28.9 10.9 12.0 35.2 38.2 48.9 0.000000
6 -47.0 -45.0 -44.0 -66.3 192.3 -51.8 0.000000
7 279.6 -93.6 -92.1 -57.7 -97.3 90.0 -0.000021
8 -53.4 -5.8 -8.0 -67.5 -26.5 -59.9 0.000000
9 160.9 1.5 -0.1 -2.4 -189.4 43.8 -0.001425
10 -37.5 -278.9 -276.0 -44.2 -276.4 -56.9 0.000000
11 142.0 58.2 56.0 -17.2 386.3 31.7 0.000855
A/A per-pair deltas (second arm minus first)

chat

Pair Hello FCP First painted rows Final rows FCP-correlated transcript surface* LoAF CLS
1 1.3 74.7 72.2 1.7 88.5 1.5 0.000000
2 -32.1 91.7 92.0 -12.5 77.1 -63.9 0.000000
3 -5.9 -49.8 -47.9 -8.5 -82.7 -50.7 0.002332
4 -88.2 -225.0 -227.9 -62.5 -46.1 -83.3 -0.000491
5 -2.9 -6.6 -8.1 -26.0 37.2 -61.8 -0.002332
6 -71.3 -143.7 -143.9 -32.9 -156.2 -19.0 0.002251
7 407.8 -53.9 -56.1 -67.4 -8.9 20.1 -0.001477
8 -50.3 23.8 23.9 -50.2 69.4 -59.0 -0.001886
9 71.3 159.6 160.0 43.6 201.6 51.2 0.000000
10 -37.9 -8.6 -8.1 -20.4 -9.2 -2.1 0.002332
11 78.6 141.1 144.0 48.7 116.1 71.9 -0.001841

dashboard

Pair Hello FCP First painted rows Final rows FCP-correlated transcript surface* LoAF CLS
1 -116.1 -10.6 -12.0 30.0 -14.8 42.6 0.000855
2 -199.9 -72.5 -72.0 -13.7 -63.8 -12.8 0.000855
3 35.8 2.3 -0.0 20.0 -22.8 28.0 0.000000
4 -175.8 -65.7 -64.0 -6.1 -273.0 -34.4 0.000855
5 72.4 -29.5 -28.0 50.8 -28.6 54.5 0.000000
6 -161.1 146.4 148.1 2.0 23.9 -37.3 0.000855
7 274.9 124.6 127.9 69.5 130.2 127.9 -0.000855
8 -80.8 -61.4 -60.1 -56.2 -13.9 -58.2 0.000000
9 223.8 131.6 132.2 49.0 132.9 24.7 -0.000855
10 -171.5 -79.7 -79.9 12.2 -150.8 -53.8 0.001425
11 207.9 -3.7 -0.0 30.3 -11.5 34.1 -0.000855

*FCP-correlated surface means the first inspected capture whose expected-display reference timestamp is at/after loader-matched FCP presentation feedback. Those timestamp semantics differ; captures lack loader identity and do not establish every actual displayed frame. Independent first-rAF value/opacity and captured pixels support the before-paint claim. Element Timing first painted rows is reported independently above.

Additional Team-scale live-fast metrics and per-pair deltas

Team-scale live-fast secondary control

Same final baseline/candidate bundles on the same AWS c7a.4xlarge; 11 alternating pairs per route. Native plugin measurements above own the primary ring gate. All times are milliseconds. Each cell is median [Q1, Q3]; Δ is candidate minus baseline.

Chat

Metric Baseline Candidate Paired median Δ Worse / 11
hello-handled 577.000 [568.000, 582.400] 567.400 [557.000, 576.500] -6.500 2
FCP 88.000 [86.000, 90.000] 88.000 [88.000, 92.000] +0.000 4
first rows (DOM) 311.700 [309.400, 316.700] 315.000 [310.900, 318.600] +0.600 6
visible transcript (Element Timing) 396.000 [392.000, 400.000] 400.000 [394.000, 404.000] +4.000 6
final rows 900.500 [884.750, 914.600] 911.800 [908.050, 916.750] +3.600 7
CLS 0.000050 [0.000050, 0.000050] 0.000050 [0.000050, 0.000050] +0.000000 0
Pair hello-handled FCP first rows (DOM) visible transcript (Element Timing) final rows CLS
1 -9.100 +0.000 +5.400 +4.000 +35.000 +0.000000
2 -3.000 +0.000 +4.500 +4.000 +0.500 +0.000000
3 -13.300 +4.000 +0.600 +8.000 +3.600 +0.000000
4 -35.700 +0.000 -2.700 +0.000 +23.800 +0.000000
5 -8.500 +8.000 +10.400 +12.000 +29.900 +0.000000
6 -1.100 +0.000 -7.300 -8.000 -22.900 +0.000000
7 +11.700 +8.000 -0.700 +0.000 +76.500 +0.000000
8 +0.200 +0.000 +1.700 +0.000 +39.100 +0.000000
9 -5.800 -4.000 +1.900 +4.000 -6.400 +0.000000
10 -24.500 +0.000 -0.000 +4.000 -4.500 +0.000000
11 -6.500 +4.000 -1.200 -4.000 -22.300 +0.000000

Dashboard

Metric Baseline Candidate Paired median Δ Worse / 11
hello-handled 593.100 [582.450, 598.350] 592.600 [587.300, 598.450] +1.900 6
FCP 92.000 [88.000, 92.000] 92.000 [88.000, 92.000] +0.000 2
first rows (DOM) 304.200 [300.200, 307.550] 303.600 [299.150, 306.450] +1.500 6
visible transcript (Element Timing) 336.000 [330.000, 340.000] 336.000 [330.000, 340.000] +0.000 5
final rows 874.400 [854.650, 889.900] 866.700 [860.050, 876.400] -13.800 4
CLS 0.000025 [0.000025, 0.000025] 0.000025 [0.000025, 0.000025] +0.000000 0
Pair hello-handled FCP first rows (DOM) visible transcript (Element Timing) final rows CLS
1 +1.900 +0.000 +1.500 +4.000 -13.800 +0.000000
2 +7.700 -4.000 -9.400 -8.000 -30.500 +0.000000
3 -9.000 +0.000 -4.800 -4.000 -18.300 +0.000000
4 +6.300 +0.000 +9.700 +12.000 -38.200 +0.000000
5 +8.300 +8.000 +7.900 +12.000 +1.300 +0.000000
6 -25.000 +0.000 +4.000 +0.000 -50.300 +0.000000
7 -6.800 +0.000 -2.600 +4.000 -14.500 +0.000000
8 -2.700 +0.000 -8.900 -8.000 +30.400 +0.000000
9 -2.100 +0.000 +4.300 +0.000 -1.000 +0.000000
10 +11.800 +4.000 -10.900 -12.000 +35.800 +0.000000
11 +15.600 +0.000 +5.000 +8.000 +50.400 +0.000000

Validation

Current head: 82193f676d2921dc021c6933128fa236de79018c, based on d6ea7bc29785656feb9e3c35e45919110880d84e (includes #190925). The rebase was conflict-free and preserves every added/deleted lane line outside the approved budget edit. Only the chat cap and its two-line approval comment change in the checker; no runtime changes or other budget changes were required. The prior P2 review stands under the lead's cap-only review instruction.

Accepted P2: live usage withdrawal

The row contract distinguishes unavailable usage (totalTokens absent, totalTokensFresh: false) from omitted enrichment (both absent). resolveTranscriptUsageFallbacks and presentSessionRow project the former, including unavailable usage without a report. Sidebar/dashboard allowlists and boot roster persistence omit both; the lifecycle producer strips totalTokens, totalTokensFresh and contextTokens together when usage is not fresh. The UI sanitizer's special case erasing the false marker is deleted. Snapshot projection clears contextUsage for explicit unavailability and retains it on true omission. ContextNotice only uses cache when neither live usage field is present, in one predicate without new state/store/config. Numeric stale totals remain approximate; measured zero remains valid. Projection 14 compatibility is unchanged.

The new regression restores a cached 95% ring/warning, admits the normalized unavailable row while the old cache prop remains, verifies immediate disappearance before snapshot write, then proves a partial row cannot restore it. This fails on unchanged pre-fix owner code and passes after repair. Existing tree full/reference equivalence retains the false fact with its identity/no-refetch assertions. The original review thread is resolved.

Final-head candidate proof

AWS c7a.4xlarge lease cbx_bf36e9fc7979, Node 24.22.1. 65 focused tests pass: composer 1 / 27.52 s wall, context meter 1 / 21.39 s, snapshot 47 / 4.97 s, retention 2 / 4.52 s, tree 14 / 4.11 s. Costs use pnpm test <file> --maxWorkers=1; they are validation costs, not performance comparisons. The changed-file gate passes with exit 0, including format, exact allocation, all typechecks, all dead-export scans and lint. CI's performance comparison procedure also passes on the final head and re-confirms 1,278,887 → 1,278,732 B (−155 B); every non-chat budget passes. The original measurement lease cbx_3b4ba22bec79 and final proof/control lease cbx_bf36e9fc7979 are released.

Exact-head CI classification

The exact-SHA PR dispatch 41444757561 is terminal failure. control-ui-performance passes, as do every selected UI e2e shard and both real-Gateway e2e shards. The catalog reconnect case does not fail, so the conditional candidate CI-profile replay is not needed. Three failed jobs plus the aggregate gate are retained without a CI rerun:

Job Failure and bounded attribution
checks-ui (3/3) Bun: chat-transcript-replies.test.ts, loaded explicit reply target, missing input. Unreproduced: the pinned-Bun single-file controls pass 24/24 on candidate (6.44 s) and main (8.68 s). A main control with the exact 2,224-file include selection, shard 3/3, three workers, four-CPU affinity and dual-runtime policy passes all 737 files / 8,306 tests in its Bun phase. Its Node phase fails a different menu-focus test. This does not prove an inherited reply failure or a fix.
checks-ui (1/3) WebKit: Details automatic docking assertion. Unreproduced: the same Details browser file passes 18/18 on main (8.91 s) and candidate (6.83 s), using the CI UI-package entrypoint, WebKit, three workers and four-CPU affinity. A bounded full main WebKit unit-project control also passes all 73 files / 696 tests (77.16 s). No root cause or fix is claimed.
android-test-play Infrastructure: Robolectric's android-all-instrumented artifact fetch ends with SocketException: Connection reset before PhotoPermissionsTest initializes. No Android source or dependency changes in this PR.

The normal ready-event exact-head CI run 41451247788 is also terminal failure. control-ui-performance is green. The catalog reconnect shard passes again; no conditional catalog replay is required. Two jobs and the aggregate gate fail:

Job Failure and bounded attribution
checks-ui (1/3) Bun: two plugin-page action lookups and the Details session direct-subagent preview assertion. Unreproduced: pinned-Bun CI=true one-file controls pass on candidate/main: plugin page 20/20 (4.76/4.91 s) and Details session 17/17 (4.34/4.35 s), four-CPU affinity and one worker.
checks-ui-e2e (4/7) config-form-integrity.e2e.test.ts: Agent List model-override round-trip exceeds its existing 120 s test timeout. Unreproduced: CI=true source and bundled projects pass 3/3 each on both candidate (53.32 s wall) and main (53.65 s), using the same four-CPU affinity and one worker. This is a bounded file control, not a shard replay.

These are separate signatures from the manual dispatch above. The UI assertions remain recorded for follow-up; passing replays do not prove an inherited failure or a fix. Neither test nor runtime was changed and no CI job was rerun to chase green. The PR is ready, open and unmerged; the complete CI run is not green.

Per the lead's 2026-11-02 instruction, the completed full UI run at cd37220512ec0c82606a206a3f0cc9b905f9cfc3 plus final exact-head CI's selected UI e2e shards stand in for the stopped full-suite rerun. The full suite is not restarted. That completed run had 892 passed / 1 failed / 3 skipped files (896); 3,388 passed / 1 failed / 4 skipped tests (3,393), 4,872.25 s. Its sole outbox migration initial-roster timeout reproduced on pinned main d9627ecb437b2a0fdaa2215137b291dbbc806137 (34.43 s single-file wall). It is not described as a full-suite green result.

The catalog virtual-clock budget flake remains lead-owned; neither its test nor reconnect helper changes here. No CI rerun or timeout increase. Do not merge; the lead owns landing.

Production size and deleted machinery

UI renderer/runtime delta +35 net LOC; generated boot inventory (+1) and deleting the obsolete chunk override (−1) net to zero, so shipping UI/config is also +35. Required growth retains four inputs, extends the existing parser/equality and carries them to the meter; no second store or meter implementation. The superseded 200 ms mount animation and forced deferred helper assignment are deleted. The projector imports narrow data helpers rather than the deferred composer view-model.

The accepted comparison builds retain Chat20 / New Session15 boot JS requests. Chat gzip 1,278,480→1,278,881 bytes (+401); New Session 784,714→784,992 (+278). Those accepted-comparison builds had advisory CSS/Chat JS warnings on baseline too. The sole later budget change is the explicitly approved exact chat cap described above.

Prescribed non-test stat (git diff --stat origin/main...HEAD -- ':!*.test.ts' ':!*test-support*' ':!docs/*'): 18 files, +184/−21 lines (net +163). The prescribed pattern also includes41 new .test.tsx lines; another87 net lines are non-shipping diagnostics/docs/allocation; shipping UI/config is the +35 above. Tests add exactly102 net lines: the prior53 plus49 for the withdrawal regression and retained-row facts. The existing allocation raises53→102 without slack; the shared scalar is unchanged. There is no new boot harness.

Chat before: first inspected FCP-correlated composer surface lacks the context ring

Chat after: cached context ring has its final value at opacity one

Dashboard before: first inspected FCP-correlated composer surface lacks the context ring

Dashboard after: cached context ring has its final value at opacity one

@clawsweeper

clawsweeper Bot commented Nov 2, 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.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui scripts Repository scripts size: S labels Nov 2, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 2, 2026
@clawsweeper

clawsweeper Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR restores cached context usage in the composer during warm reloads and removes the ring’s mount fade.

Example: Reload a chat whose saved usage is 14,000 of 100,000 tokens.

  • Before: The composer initially lacks its usage ring, which arrives with live data and fades in.
  • After: The cached ring immediately shows 14%, then updates in place when live usage arrives.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The focused implementation has no identified correctness defect, while the submitted evidence remains at the experimental harness stage.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: The context ring appears after the rest of the cached composer and then fades in.
Reason: Stable cached presentation has clear user value, and maintainer authorship establishes direction; the explicitly experimental status remains appropriate.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep this PR open as an explicitly paused maintainer experiment; current main still lacks cached context-ring restoration, and no concrete introduced defect was found.

Priority: P3
Reviewed head: f6a2370ff8dda6b6aeaa3ecb682860163fe09c81

Before merge

  • 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

None.

Tests

  • Missing end-to-end proof: The declared real-Gateway paired reload experiment, inspected before/after compositor frames and latest-stable upgrade with retained settings and history remain unshown.
Agent review details

How this fits together

The Control UI projects Gateway session usage into its existing scoped browser snapshot and supplies cached display inputs to the composer until complete live usage is available.

flowchart LR
  A[Gateway session usage] --> B[Session snapshot projection]
  B --> C[Scoped browser snapshot]
  C --> D[Chat pane]
  A --> E[Composer context model]
  D --> E
  E --> F[Context usage ring]
Loading

Technical review

Best possible solution:

Retain this focused implementation only if the declared experiment demonstrates earlier ring paint without worsening reload performance.

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

Current main derives the ring only from live usage and applies a mount fade; the prior experiment independently records its late arrival on active chat and dashboard reloads.

Is this the best way to solve the issue?

The patch uses the existing scoped snapshot and live usage resolver, preserves live precedence, and removes only decorative motion; no smaller complete repair or unnecessary production machinery was identified.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit e752141 adds ui/src/pages/chat/chat-session-state-snapshot.ts:18 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e7521410fa0a; files: ui/src/pages/chat/chat-session-state-snapshot.ts)
  • Vyctor H. Brzezowski: Raw commit 50c7400 adds ui/src/styles/chat/layout.css:783 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 50c7400a9acb; files: ui/src/styles/chat/layout.css)
  • Vincent Koc: Raw commit 02daed9 adds ui/src/pages/chat/session-message-cache.ts:23 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 02daed924fb9; files: ui/src/pages/chat/session-message-cache.ts)

PR surface

Source +34, Tests +52, Docs +7, Other +80. Total +173 across 16 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 8 40 6 +34
Tests 3 52 0 +52
Docs 1 7 0 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 4 86 6 +80
Total 16 185 12 +173

Review metrics

Metric Value Why it matters
Production versus regression code UI production +40/-6 lines; tests +52 lines Growth carries four display inputs through the existing owner and extends existing browser and persistence scenarios.
Added surfaces Four persisted display fields; one diagnostic flag contextUsage stores used, limit, approximate and fromLastPrompt; --active-targets changes only the proof fixture.

Labels

Label changes:

  • add P3: This improves visual stability during warm reloads without repairing a blocked workflow.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.

Label justifications:

  • P3: This improves visual stability during warm reloads without repairing a blocked workflow.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.

Rank-up moves

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

  • Publish the declared paired reload results and inspected before/after compositor evidence.
  • Demonstrate latest-stable upgrade compatibility with existing settings and history intact.

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 November 1, 2026, 10:33 PM ET / November 2, 2026, 03:33 UTC.

@steipete
steipete force-pushed the steipete/coldload-context-ring-cached branch 2 times, most recently from cfc7425 to ebdda71 Compare November 2, 2026 04:02
@steipete steipete changed the title experiment(control-ui): cached composer context ring [do not merge] perf(control-ui): paint cached context usage with the composer Nov 2, 2026
@steipete
steipete marked this pull request as ready for review November 2, 2026 05:24
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 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-11-02T13:18:22.203820Z 82193f6 Draft marked ready
ℹ️ 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.

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

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

@steipete
steipete marked this pull request as draft November 2, 2026 05:38
@steipete
steipete force-pushed the steipete/coldload-context-ring-cached branch from ebdda71 to d60a894 Compare November 2, 2026 05:47
@steipete
steipete marked this pull request as ready for review November 2, 2026 07:10
@steipete
steipete marked this pull request as draft November 2, 2026 09:11
@steipete
steipete force-pushed the steipete/coldload-context-ring-cached branch from d60a894 to cd37220 Compare November 2, 2026 09:11
@steipete
steipete marked this pull request as ready for review November 2, 2026 09:13
@steipete
steipete marked this pull request as draft November 2, 2026 11:15
@steipete
steipete force-pushed the steipete/coldload-context-ring-cached branch from cd37220 to 696d0bd Compare November 2, 2026 11:20
@steipete
steipete marked this pull request as ready for review November 2, 2026 11:26
@steipete
steipete marked this pull request as draft November 2, 2026 11:57
@steipete
steipete force-pushed the steipete/coldload-context-ring-cached branch from 696d0bd to 3be1382 Compare November 2, 2026 12:05
Preserve the Gateway unavailable-usage fact through row admission, clear the existing display snapshot, and restrict the renderer fallback to omitted usage enrichment. Prove the restored warning disappears before snapshot replacement and stays absent on later partial rows.
@steipete
steipete force-pushed the steipete/coldload-context-ring-cached branch from 3be1382 to 82193f6 Compare November 2, 2026 12:18
@steipete
steipete marked this pull request as ready for review November 2, 2026 13:14
@steipete
steipete merged commit ee3d681 into main Nov 2, 2026
263 of 274 checks passed
@steipete
steipete deleted the steipete/coldload-context-ring-cached branch November 2, 2026 13:48
@steipete

steipete commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Landed as ee3d681 with a pinned-head admin merge at 82193f6.

Exact-head CI was red only on suites this PR does not touch or import:

  • checks-ui (1/3), Bun shard: two plugins-page.test.ts action lookups ("No plugin action matching …") and chat-details-session.test.ts subagent preview (expected null not to be null).
  • checks-ui-e2e (4/7): config-form-integrity.e2e.test.ts:80 Agent List model-override round trip hit the 120 s timeout.

The PR adds no source modules, and none of those suites import the changed files. CI=true single-file controls with the same pinned Bun and four-CPU affinity pass on both this head and main: plugins page 20/20, Details session 17/17, config form 3/3 (source and bundle). control-ui-performance passes on the exact head; chat boot JS gzip is 1,278,897 → 1,278,732 B (−165 B) against the CI base.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 3, 2026
…law#190824)

On a warm reload the composer's context ring now paints its final value in the first composer frame instead of fading in after live usage arrives. The existing scoped session snapshot retains four display inputs (used tokens, resolved limit, approximate flag, last-prompt-budget flag). Partial roster rows keep the last admitted display; complete live usage replaces it in the same ring element. An explicit Gateway "usage unavailable" fact (absent totalTokens with totalTokensFresh:false) is no longer erased by the UI row sanitizer, so withdrawn usage clears the cached ring and a later partial row cannot restore it. The ring's 200 ms mount fade and the context-budget helper's obsolete forced deferred-chunk assignment are removed. No new store, config, protocol or Gateway change.

Native 11-pair proof (AWS c7a.4xlarge, Team-scale synthetic fixture, 80 ms RTT): ring final at the first composer frame 0/11 -> 11/11 on Chat and Dashboard; snapshot +86 B; no secondary crosses the regression rule (Chat CLS +0.002 paired, IQRs overlap).

Budget: parallel campaign landings left main at 1,278,887 B chat boot JS gzip, over the 1,277,887 B cap. Rebased onto current main, this PR measures 1,278,732 B (-155 B; new-session boot -170 B), and the cap is set to exactly that value with the existing 64 B build variance (lead-approved exact raise, 2026-11-02).

CI red on unrelated suites (checks-ui 1/3 Bun: plugins-page action lookups and Details subagent preview; checks-ui-e2e 4/7: config-form-integrity 120 s timeout). None import touched modules; CI=true single-file controls pass on candidate and main.
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 P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant