Repository navigation
perf(control-ui): restore cached transcript row facts together - #184334
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: blocked before merge. What this changesThis 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.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete 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 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe 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]
Technical reviewBest 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:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9e173826901b. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +175, Tests +393, Generated +1, Other +156. Total +725 across 39 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 26, 2026, 3:28 AM ET / 07:28 UTC. |
There was a problem hiding this comment.
💡 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".
| const parent = document.createElement("div"); | ||
| parent.style.display = "contents"; |
There was a problem hiding this comment.
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 👍 / 👎.
b0a8611 to
fe3e802
Compare
|
The run-body spacing finding is fixed on 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 @clawsweeper re-review |
|
🦞👀 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.
fe3e802 to
66e8660
Compare
|
Final head: 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 @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…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).
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
untrackand 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 mainbcfdc7205c0068ade5ba646fe9427952e7703f8c. 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, baseline54408a978fc91fd20130b6f904534b47c8dfe25a. AWS Crabboxcbx_f1a7eb051156, fixedc7a.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-fastlatency, 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.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
66e86608f6cad258eb0981e1b8cad67435a4a886is scoped-clean through P2. Exact-head CI completed: 41 jobs passed, 25 skipped; onlycheck-lintand its aggregate gate failed. Every selected UI e2e shard passes. The lint failure is solely the explicitly approved one-entryuntrackallowance (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 isextensions/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, anddeepseek-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 54408a978fc91fd20130b6f904534b47c8dfe25acompleted 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:
untrackgrowth (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.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.smallfor the requestedc7a.4xlargebecause 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.tsxfiles. 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=1on the final AWS lease.ui/src/e2e/chat-agent-run-transcript.e2e.test.tsui/src/e2e/chat-flow.reactions.e2e.test.tsui/src/e2e/chat-native-turn-activity.e2e.test.tsui/src/e2e/chat-retry-failure.e2e.test.tsui/src/e2e/chat-snapshot-route.e2e.test.tsui/src/e2e/chat-steer-deferred-custody.e2e.test.tsui/src/e2e/chat-video-gallery.e2e.test.tsui/src/e2e/chat-widget-retention.e2e.test.tsui/src/e2e/chat-worked-for-visualization.e2e.test.tsui/src/e2e/dashboard-cold-load.e2e.test.tsui/src/e2e/team-scale-cold-load.e2e.test.tsui/src/pages/chat/chat-pane-reactions.test.tsui/src/pages/chat/chat-pane-offline-metadata.test.tsui/src/lib/protocol-validators.generated.test.tsui/src/pages/chat/components/chat-run-failure-notice.test.tsui/src/pages/chat/components/chat-activity-disclosure.test.tsui/src/pages/chat/components/chat-message-entry.test.tsui/src/pages/chat/components/chat-message.test.tsxui/src/pages/chat/components/chat-message-group.solid.test.tsxui/src/pages/chat/components/chat-transcript-render.test.tsui/src/pages/chat/components/chat-transcript-lazy-rows.test.tsxui/src/pages/chat/components/chat-divider.browser.test.tsxui/src/pages/chat/chat-history-warm-startup.test.tsui/src/test-helpers/control-ui-team-scale-fixture.test.tsui/src/pages/chat/components/chat-transcript-invalidation.test.tsui/src/test-helpers/control-ui-e2e.sessions.test.tsui/src/pages/chat/session-message-cache.test.tsui/src/pages/chat/session-snapshot-store.test.tsui/src/pages/chat/session-snapshot-write.test.tsui/src/pages/chat/chat-pane-snapshot-hydration.test.tsui/src/pages/chat/chat-pane-session-hydration.test.tsComplete 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}
Every paired delta
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}
Every paired delta
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.
All captures were inspected in full and contain synthetic fixture data only. Stop before merge; the campaign lead owns landing.