Repository navigation
perf(control-ui): settle cached transcripts before reconnect - #168154
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: blocked before merge. What this changesThis PR anchors cached conversations before reconnect and restores cached participant, duration, and task-progress display data. Example: Reload agent:main:dashboard:cold-load while the Gateway handshake is held.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep this PR open for its useful cached-transcript repair; the previously reported progress-invalidation defect still blocks merge. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe Control UI restores account-scoped browser snapshots into the chat pane, measures virtual transcript rows, and reconciles cached display data with live Gateway results. flowchart TD
Browser[Browser reload] --> Cache[Account scoped snapshots]
Cache --> Pane[Chat pane]
Pane --> Transcript[Transcript virtualizer]
Pane --> Progress[Progress card store]
Gateway[Live Gateway results] --> Pane
Gateway --> Progress
Transcript --> Display[Visible conversation]
Progress --> Display
Technical reviewBest possible solution: Keep the anchoring repair and make progress invalidation resume admitted reads through the existing store. Do we have a high-confidence way to reproduce the issue? Fetched main retains empty-shell attachment and delayed overscan expansion, matching the supplied failing browser comparison; this read-only review ran no target code. Is this the best way to solve the issue? The change repairs initial attachment and measurement ordering at their owners, but its new progress invalidation path loses subsequent updates. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0a55cbe057e0. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +183, Tests +382, Docs +4. Total +569 across 38 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes: No label 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 HistoryReview history (2 earlier review cycles)
Reviewed October 10, 2026, 1:56 AM ET / 05:56 UTC (Revision 3). |
f54114b to
ebb473a
Compare
Keep the initial end anchor until the full bounded row buffer has been measured, and remove the empty-shell attachment and delayed overscan expansion that started reloads at the top or moved their first painted viewport. Retain participant and completed-work display metadata and task progress in the existing account-scoped transcript cache. Reconcile live results through their existing owners, including authoritative clearing and cache invalidation.
ebb473a to
80b7873
Compare
…w#168154) * perf(control-ui): settle cached transcripts before reconnect Keep the initial end anchor until the full bounded row buffer has been measured, and remove the empty-shell attachment and delayed overscan expansion that started reloads at the top or moved their first painted viewport. Retain participant and completed-work display metadata and task progress in the existing account-scoped transcript cache. Reconcile live results through their existing owners, including authoritative clearing and cache invalidation. * test(control-ui): stabilize cold browser dependency loading * test(control-ui): exercise hydrated snapshot and reply ownership * test(control-ui): settle transcript maintenance fixtures
What Problem This Solves
Fixes a cached conversation moving after it appears when a signed-in operator reloads a dashboard deep link. The campaign trace showed cached messages at 3.728 seconds, scrolling until 3.902 seconds, metadata arriving at 10.260 seconds, and task progress at 12.980 seconds.
User Impact
Warm reloads open at the transcript's final end anchor with reply context, completed-work timing, and saved task progress already available. Identical live history reconciles without moving the transcript or replacing the progress-card element.
The disposable browser snapshot projection advances to version 2. Older projections are skipped and a connected visit repopulates them. There is no server schema change or new configuration option.
Why This Change Was Made
The empty shell consumed the virtualizer's initial end offset before cached rows arrived. A second startup phase then expanded overscan from two rows to six, changing measured heights after paint. This removes both paths and settles the complete bounded initial window before the next animation frame. Saved-reader restoration and explicit scroll commands retain ownership.
Participant and timing facts and the last progress card now travel through the existing account-scoped transcript cache. They remain display data: live session/progress owners reconcile them, including authoritative clearing, account changes, and cache invalidation.
Product LOC is +174 across 22 files: cache serialization/validation, display projection, and scoped reconciliation force the growth; the scroll simplification deletes 93 lines of superseded startup machinery. A separate +9-line browser-test configuration fix preoptimizes imports observed causing Vite to reload a cold mounted-pane test. The requested diff filter therefore totals +183, including that test harness.
Evidence
One synthetic Playwright flow warms the real snapshot owner, reloads with hello held, samples the first 20 transcript frames, and continuously samples through live reconciliation. Baseline production code fails the assertion; the candidate passes.
All 29 sampled live-reconciliation frames remained at scrollTop 5,104 with zero end gap. Transcript/card position and height stayed unchanged, and the existing progress-card DOM element was retained. Screenshots below are inspected synthetic fixtures; no private campaign captures are included.
The rebase includes the session PR host CI repair and dashboard first-paint changes. Reload, duration, reply-attribution, and frame-coalescing checks were repeated after incorporating the later steering/subagent changes.
All authorized local files ran serially with
--maxWorkers=1, waiting whenever host load exceeded 40. 424 distinct tests passed: the reload E2E, 38 browser siblings, 195 originally changed unit cases, and 190 cases in the four fixtures corrected after CI. The baseline E2E failed as intended (27.22 seconds). After the latest product rebase, candidate wall time was 29.77 seconds; browser siblings took 8.33 seconds (end-follow), 6.64 seconds (geometry-updates), and 3.92 seconds (frame updates).session-progress-cards.test.tschat-history-warm-startup.test.tssession-snapshot-write.test.tschat-transcript-duration.test.tschat-transcript-replies.test.tssession-snapshot-store.test.tssession-snapshot-prewarm.test.tschat-transcript-controller.test.tschat-transcript-geometry.test.tssession-prefetch.test.tschat-view.test.tschat-pane-history-maintenance.test.tschat-pane-snapshot-hydration.test.tsAn initial geometry browser invocation failed before collection when Vite discovered dependencies and reloaded the test page. Its existing preoptimization list now includes those observed imports; the cold rerun passed without a reload. Fresh detached review of that delta was clean, as was review of the product change.
Earlier remote evidence: AWS lease
cbx_dec5fadd66a5passed 214 focused tests on the intermediate candidate. Testboxtbx_01m4h9ahe165qvx9728fdpc4fdremained queued, and subsequent remote sync was blocked by the saturated uplink. The final local runs use the explicitly approved single-file exception. All issued remote leases were released. GitHub CI supplied the final changed-file gate and passed on the final head.CI follow-up
CI exposed four fixtures that needed to follow the new lifecycle: prefetch now expects the cached display projection, Reply exercises an actual rendered message, stored hydration supplies a valid typed session row, and maintenance scrolling finishes initial anchoring before changing the scroll range. Their behavioral assertions remain intact. The latest two fixture repairs pass all 10 cases locally. Fresh detached review is clean. CI run 38028816500 passed on
80b78733d75fdeda4fa9a5ff049488c6d61e05a3: 33 successful jobs, 24 intentionally skipped. All three UI shards, all selected browser E2E shards, production/test types, guards, and changed-node checks passed. The UI shards took 306–348 seconds and browser E2E shards 200–221 seconds (whole-shard wall times, not incremental test cost). Earlier fail-fast cancellations are not counted as independent defects. No jobs were rerun.