Repository navigation
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: needs maintainer review before merge. What this changesThis PR limits automatic chat-history filling to one attempted older page while preserving reader-driven pagination. Example: A short chat starts at offset 2 and its first older page advances to offset 6 without filling the viewport.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this maintainer-authored experiment open and honor its explicit do-not-merge hold; current main retains three-page boot filling, and inspection found no concrete introduced defect. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Control UI history owner combines settled transcript geometry and reader intent to request older Gateway history pages and prepend them to the conversation. flowchart LR
A[Chat startup] --> B[Transcript placement]
B --> C[History owner]
D[Reader input] --> C
C --> E[Gateway history request]
E --> F[Transcript messages]
F --> B
Technical reviewBest possible solution: Conclude the bounded-fill experiment with comparable reload evidence while retaining the existing history owner and reader-controlled recovery. Do we have a high-confidence way to reproduce the issue? Current main demonstrably permits three automatic pages for an underfilled transcript; the PR reports a matching three-request reload, but no target code was executed during this review. Is this the best way to solve the issue? The change directly bounds unsolicited downloads in the existing owner without adding policy layers or disturbing reader intent, staged prefetch, failure handling, or offset-zero refill protection. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a1c134d1f91e. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -1, Tests +28, Docs +2. Total +29 across 5 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 17, 2026, 5:51 AM ET / 09:51 UTC. |
What Problem This Solves
Bounds automatic older-history downloads when a signed-in operator reloads a dashboard or chat deep link with a short collapsed transcript.
User Impact
The change permits at most one automatic older page, using the viewport itself as the fill target. Further history, including the offset-zero bounded-cache refill, requires reader intent. Upward paging keeps its 1,200 px prefetch margin. Very short transcripts may leave unused space until the reader scrolls up or chooses Show earlier.
Why This Change Was Made
The previous implementation allowed three boot pages and expanded the target to viewport + 1,200 px after page one. A collapsed history shorter than that target kept downloading through the cap. A single attempted-fill Boolean replaces the counter and expanded-margin branch. Production LOC: 8 added / 9 removed, net −1. No Gateway schema, stored-shape, config, or protocol changes.
Evidence
The campaign observed about 2.7 MB of older-history responses on a signed-in dashboard deep-link reload. The synthetic Team-scale fixture reproduces three automatic pages at offsets 79, 404, and 729 (2,520,253 bytes), with the full collapsed history about 2,106 px tall. The first older page reaches 1,461 px versus a 1,238 px transcript viewport, yet the baseline continues toward the unreachable 2,438 px target. A source-mapped profile confirms syncHistoryObserver → loadOlderMessages → performOlderMessagesLoad. The fix stops after that first page.
Quiet AWS: c7a.4xlarge, 16 observed CPUs / 30 GiB RAM, repo Playwright Chromium. Final comparison lease
cbx_54c79cb77899, runrun_c3c61a2b046924f91642fed9a148dc78; one fixed instance for all 116 valid runs. Eleven interleaved pairs per tool-heavy case; seven per normal case. Unprofiled timing runs use a row-count-only growth probe with no geometry reads. The primary LoAF gate is the Team-size warm reload; the remaining cases use the campaign no-regression rule. Cold means an empty persisted transcript cache; browser assets remain warmed by the setup navigation.LoAF blocking in ms: median [Q1, Q3].
In both large tool-heavy cases, older-history RPCs fall 3 → 1, raw response bytes 2,520,253 → 1,107,704 (−56.0%), and observed row-growth steps 7 → 4. Both small tool-heavy cases fall 2 → 1 RPC, 2,208,852 → 1,107,704 bytes (−49.9%); row-growth steps remain 5. Normal cases make zero older-history requests in both versions and retain the same growth-step count. Large warm FCP is 444 ms in both versions; large normal FCP is 484 ms in both.
The normal large-session increase is noise under the updated campaign rule: its IQRs overlap ([766.5, 884.5] versus [840.5, 936.5]), and only 5/7 pairs are worse, below the 6/7 threshold. Both versions issue zero older-history requests in this case, so the changed fill path has identical behavior. Normal-small improves 649 → 622 ms (6/7 pairs). A secondary regression requires non-overlapping IQRs or at least 6/7 (9/11) worse pairs; none of these cases meets that criterion. The primary large tool-heavy warm case improves in all 11 pairs and has non-overlapping IQRs.
All per-pair LoAF deltas (candidate − baseline, ms)
Correctness and validation
Rebased on current main, retaining #175393's startup-cursor fix. Focused autofill and history units pass (13 + 29 tests). The two changed autofill assertions were verified to fail against the previous three-page implementation. Fresh full UI E2E, changed-file checks, and independent review through P2 are in progress; final results will be recorded here.
The retained performance comparison predates this rebase. No measurement timings were taken on the loaded Mac. Initial harness attempts and the first timing batch are excluded: bundle identity needed matching, the tool-heavy fixture needed transcript readiness rather than a header-title assertion, and the growth probe needed layout-free counting. All measurement leases were stopped. No private capture was uploaded.
Release-note context: avoid downloading the full collapsed history during a Control UI reload while preserving reader-driven backscroll.