Repository navigation
fix(gateway): preserve history fragments across paged reads - #186536
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 preserves complete transcript-row display fragments and adds existing directional cursors to ordinary history pages. Example: Read an assistant row containing Commentary A, Commentary B, and Final answer with limit: 1, then request offset: 1.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR completes the earlier regression-only draft with a focused repair for a defect still present on main; no actionable introduced bugs were found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherGateway history handlers read persisted transcript rows, project display messages, and return byte-bounded pages with offsets and source-bound continuation cursors. flowchart LR
A[History client] --> B[Gateway history handler]
B --> C[Transcript readers]
C --> D[Display projection]
D --> E[Source group selection]
E --> F[Response budget and cursors]
F --> A
Technical reviewBest possible solution: Use the shared source-group selector and existing cursor owner while preserving byte budgets, transcript bytes, and current sharing checks. Do we have a high-confidence way to reproduce the issue? The concrete two-row regression matches main's strict tail slice and source-based offset advancement; the author reports an intended red-to-green result, and this read-only review ran no target code. Is this the best way to solve the issue? The patch repairs selection at the shared producer, removes the competing offset cap, and reuses existing cursor and budget contracts without unnecessary machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ff7c37bed649. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +18, Tests +110, Docs +1. Total +129 across 5 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 HistoryReview history (1 earlier review cycle)
Reviewed October 28, 2026, 2:08 AM ET / 06:08 UTC (Revision 2). |
|
@clawsweeper re-review Please review current head |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…#186536) * test(gateway): reproduce split history source fragments * fix(gateway): keep paged history source groups reachable
What Problem This Solves
Fixes missing assistant commentary when a small history page splits the display fragments of one stored transcript row.
User Impact
Complete source-row groups remain reachable when opening and paging history. Ordinary tail and numeric-offset pages can now return directional history cursors, allowing clients to continue through bounded pages without reopening an anchor.
The requested message count is a soft target, including on the initial tail: a complete source group may exceed it. The existing response byte budget and fetchable oversized-message references still apply. Existing numeric pagination remains available.
Why This Change Was Made
The initial-tail count cap could return only the final fragment of an assistant row, while
nextOffsetskipped that entire stored row. Reuse the existing source-group pagination policy for both head and offset admission, removing the separate adjacent-only offset cap and strict head slice. Record consumed message endpoints before display filtering and carry those primitive facts into the existing cursor owner; hidden pages can then make progress without retaining another raw-message array.Native cursor identity, current sharing checks, retained reset intervals, active-leaf and delta metadata remain governed by their existing owners. Claude CLI paging keeps its injected sequence resolver and source-reset semantics. No schema, config or runtime adapter changes.
Evidence
b822d73on frozen26e71cereturned only the final answer instead of two commentary fragments plus the final answer. The real SQLite/production history-handler/serialized-frame test failed at the intended assertion; seven siblings passed (149.10 s wrapper, Node 26.12.1, Darwin arm64). Response/transport callbacks were mocked.107f694. Initial lint found one missing test-sort comparator; that one-line correction subsequently passed targeted type-aware lint and its three affected paging cases (15 skipped, 38.60 s wrapper) on the qualified Darwin/Node 26 owner. The original remote wrapper ended with exit 1, including a cleanup-reconciliation warning; this is not an aggregate-green remote run. Exact-head CI run 40641579246 completed successfully fordbc7d15. The current ClawSweeper review reports no findings, Before merge: None, and no Rank-up moves list.Production: +65/-47 (net +18); tests: +166/-56 (net +110); docs: +2/-1. The production increase records cursor progress at its producer and reuses existing count policy. This is a pagination foundation for bounded history loading; no deployed Firefox heap reduction, live browser/WebSocket proof or performance measurement is claimed.