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 adds a plan to compare older-history page budgets while preserving initial conversation loading. Example: Scroll backward through a long conversation with a 1 MiB older-history budget.
Review scores
ProductKind: Docs · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open as the explicitly non-merging experiment draft; the documentation-only diff introduces no application defect. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Control UI history request owner sends paginated chat.history requests to the Gateway and supplies returned messages to the conversation view. flowchart LR
A[Reader scrolls backward] --> B[Control UI history owner]
B --> C[Gateway chat history]
C --> D[Older message page]
D --> E[Conversation view]
Technical reviewBest possible solution: Retain the experiment draft until its owner records the comparison and selects any production change supported by the results. Do we have a high-confidence way to reproduce the issue? This PR proposes measurement rather than reporting or fixing a reproducible defect; no target code was executed. Is this the best way to solve the issue? The note is a minimal experiment description using the existing history owner, with no unnecessary production machinery or test scaffolding. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against acdbc6017d6d. SecurityNone. EvidenceWhat I checked:
PR surfaceDocs +5. Total +5 across 1 file. Added test files: 0. View PR surface stats
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 18, 2026, 4:16 PM ET / 20:16 UTC. |
What Problem This Solves
Tests whether larger older-history pages make backscroll through long conversations faster without long arrival frames. The current client budget is 1 MiB despite a 6 MiB server ceiling and compressed transport.
User Impact
Experiment rejected; no production change. Keep 1 MiB. All larger budgets improve total traversal time, but none meets the approximately 120 ms arrival-frame target. At 2 MiB, tool-heavy traversal drops from 19 pages / 6.55 s to 10 pages / 4.25 s, while worst-arrival median rises from 142 to 171 ms (worse in all seven pairs, non-overlapping IQRs). The baseline also exceeds the target on these long stress cases; the existing render cost is not being declared acceptable.
Why This Change Was Made
Compression reduces bytes, while the client still pays native history projection and rendering work. This draft enabled the fresh-PR remote-clone experiment. It contains only a five-line experiment note; runtime LOC delta is 0, and no production file changed. No larger default or slicing workaround is proposed from this evidence.
Evidence
56 unprofiled runs on one quiet AWS c7a.4xlarge, seven interleaved rounds per history shape, plus separate source-mapped profiles. Exact head:
090fe184415c30d3b30b0c486aa18e1686cbbb11; main base:e08207aea9d41cde8a8621fb1f2d3ce1296faea4.Environment and method
AWS Crabbox
cbx_4964b2ff9098, fixedc7a.4xlarge, 16 vCPUs (AMD EPYC 9R14), 30 GiB RAM. Node v24.19.0, pnpm v12.11.1, and the repository Playwright Chromium build (Chrome for Testing 156.0.8078.4). One instance and one boot ID served the complete comparison. Pre-run load averages ranged from 0.52 to 2.47. Setup, UI build, and initial attribution succeeded in run_ea1047a451d2147bc40f4b0708f9e31e. The curve continued through the sanctioned SSH transport on that retained lease.The production-bundle Team-scale benchmark retained its canonical shell, Online roster, plugin inventory, and common 240-message tail. The older prefix contains either 4,000 plain-text messages (1,000-character questions and 7,200-character answers) or 6,200 messages in 100 tool-heavy turns (30 call/result pairs per turn, collapsed activity). Full histories contain 4,240 and 6,440 messages respectively. These are long synthetic stress cases, not copies of a private conversation.
Seven rounds per history shape covered 1/2/3/5 MiB, reversing order on even rounds: 56 unprofiled browser runs. All use the same bundle and source, Chromium, 35 ms synthetic inbound latency, and 4 ms minimum reply spacing. The benchmark changes only outgoing older-history
maxBytesafter the reload measurement. The server fixture honors that budget and the unchanged 1,000-message limit. Startup requests remain untouched.Each measured page goes through the native history owner with staging disabled (
loadOlderMessages(false)) to isolate one request and one prepend. The driver moves to older content between pages and reaches the beginning. It validates progress, exactly one history response per step, and a visible transcript viewport. This is a controlled page-through experiment; it does not measure continuous-wheel prefetch effectiveness or a real Gateway network.Page fill is response arrival to the visible-viewport receipt after two paint opportunities. LoAF records are drained after the phase. Arrival-frame statistics include completed frames after response arrival and before that page's filled receipt; the next scroll can begin in the same task as the receipt, so its later-ending frame is attributed to the overall traversal instead. The whole-traversal maximum includes every scroll and the final movement to the beginning. Raw data retains the timestamps and the original overinclusive prototype field;
analyze.pyreconstructs the completed-arrival metric. Frames below the browser's 50 ms LoAF threshold are conservatively reported as at most 50 ms.Bytes below are actual history response JSON bytes. Compression is a separate level-1, fresh-context permessage-deflate estimate, excluding WebSocket/TLS overhead; the mock transport does not negotiate compression. Estimates run outside the measured interval. Profiled setup runs and the two superseded boundary-calibration attempts are excluded from the curve.
Curve
Times are milliseconds, shown as median [Q1, Q3] across seven runs. Arrival is each run's worst completed arrival frame. Fill is each run's median per-page fill. Byte totals cover history responses only.
The tool-heavy 3 and 5 MiB requests return the same pages: the 1,000-message cap binds at about 2.981 MiB. Normal 5 MiB requests bind at about 4.057 MiB. Response envelopes can slightly exceed the message-only budget.
Every larger budget improves total traversal with non-overlapping IQRs and all seven paired deltas below zero. None passes the arrival-frame gate. At 2 MiB, tool-heavy traversal improves 6.55 → 4.25 s and 19 → 10 pages, while worst-arrival median rises 141.7 → 171.0 ms (all seven pairs worse, non-overlapping IQRs). At 3 MiB it reaches 3.45 s / 7 pages, but arrival rises to 174.4 ms. Compression saves roughly 6× in estimated bytes; it does not remove the render work.
Paired deltas against 1 MiB
Candidate minus baseline, in round order. All values are milliseconds. No slow sample was discarded.
Reload control
All 56 reloads issue zero boot
chat.historycalls and one unchanged 38,763-bytechat.startupresponse. This synthetic response does not model the live retained-receipt fast path. No reload timing metric regresses under the campaign's non-overlapping-IQR or ≥6/7 paired-sign-plus-size rule. The occasional slow paints remain in the data. Because the budget override activates after reload, these are unchanged-code controls, not a shipped-candidate reload proof.Attribution and limits
Source-mapped
--cpu-profilecaptures executerequestOlderChatHistoryPage,performOlderMessagesLoad, the pane projection, and the real transcript render path. On the 1 MiB diagnostic runs, Solid flush contains 65.4% of sampled normal-history work and 62.1% of tool-heavy work.maxTranscriptScrollOffsetaccounts for 19.4% and 15.5% self time; its principal chain issyncHistoryObserver→isMaintenanceScroll→ transcript geometry. The supplied live source-mapped frame places the same geometry function at 12.3% of sampled busy time. This demonstrates the relevant hot path at a comparable share, while the synthetic long histories and controlled scroll pattern limit extrapolation to a particular live conversation.The immediate history-apply function accounts for only 0.9–1.5% inclusive time in those diagnostic runs. The evidence points to render/layout work, not a large synchronous history-apply loop. It does not prove that a slicing change at the request owner would remove that cost, and no scheduling, caching, or transport workaround was added. Remaining rendering cost is not claimed to be inherent.
The separate 2 MiB
--cpu-profile-comparecaptures preserve that attribution: Solid flush contains 58.1% (normal) and 54.8% (tool-heavy), direct history application 1.0% and 1.4%, and transcript geometry 15.4% and 12.8%. Median synchronous message dispatch is approximately 11.0 and 10.2 ms. These profiles are diagnostic, not samples in the timing table.Frozen curve probe hashes:
older.init.js:c918ec138a7155a8ca7de9d181e30668267801df6923e1e1baef190458a8c2c4history.ts:c8e7ffb9dc92dfe5751a79e23908cec244c8251a76cdea74fc1072253f0649c37e46ebab39e7442a7adeefc50041295476cfe4230c8e4f248b4ee3ac207722d4Validation and disposition
The UI production build and startup-asset budget checks passed on AWS. Both history shapes reached their beginning in all 56 unprofiled runs; exact source/mode, seven pairs per cell, page counts, response count, and viewport progress were checked. Separate profile captures passed. The local proof scripts passed Python/JavaScript/shell syntax checks and
git diff --checkpassed.No production UI file changed, so no regression test or full UI suite was added/run for a candidate that is being rejected. The experiment-note commit received a clean P0–P2 autoreview. Its exact-head GitHub checks finished with 7 pass, 53 skip, 0 fail; those checks do not validate the ignored benchmark prototype.
Proof files are under
.local/l142/:analysis.json,curve/,curve.log,profile-anchor/, the benchmark extension (history.ts,older.init.js,patch-bench.py),measure.sh, andanalyze.py. The local source worktree stays on the lane branch. No real account, private capture, live Gateway, schema, or stored server shape was used or modified.Lead follow-up: reduce the transcript commit/render cost before raising the page budget, or explicitly choose a higher responsiveness budget. This lane supplies no passing larger default.