Repository navigation
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 18, 2026, 11:57 AM ET / 15:57 UTC. Summary PR surface: Source +295, Tests +363, Other +436. Total +1094 across 10 files. Reproducibility: yes. source-reproducible: the supplied benchmark and changed reader paths describe a 100,000-event transcript whose visible HTTP/SSE page previously materialized the full transcript. Exact-head live reproduction evidence is still missing. Review metrics: 1 noteworthy metric.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: After the parent foundation lands, rebase this branch and retain one canonical visible-history reader with a documented, tested cursor transition that proves both an upgraded numeric cursor and the new opaque cursor in HTTP and SSE flows. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: the supplied benchmark and changed reader paths describe a 100,000-event transcript whose visible HTTP/SSE page previously materialized the full transcript. Exact-head live reproduction evidence is still missing. Is this the best way to solve the issue? Unclear: sharing one active-projection reader is a maintainable direction, but the public numeric-to-opaque cursor transition needs owner approval and exact-head upgrade proof before this can be called the best solution. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7bded09b6175. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +295, Tests +363, Other +436. Total +1094 across 10 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (4 earlier review cycles)
|
e84b451 to
b628667
Compare
7bc4bbe to
c05bd04
Compare
b628667 to
cf8eeb1
Compare
c05bd04 to
a87874c
Compare
cf8eeb1 to
7ff4bab
Compare
b86b8b6 to
1699baa
Compare
cb90b46 to
69e4633
Compare
1699baa to
089687a
Compare
Parent stack: #110374 must land first. This draft is based directly on
josh/clawdbot-d02.1.9.1.40-db6-generation-cursorsand contains only the visible HTTP/SSE history follow-up.What Problem This Solves
Deep
GET /sessions/:sessionKey/historypages and SSE history refreshes currently materialize and deserialize the full transcript before returning a small visible page. A 50-message request against a 100,000-event active transcript therefore incurs latency and memory proportional to total transcript size.Why This Change Was Made
Visible JSON and SSE reads now share one internal cursor/read owner backed by the existing
session_transcript_active_eventsprojection and indexed keyset access from #108851. The opaque cursor is session-scoped, generation-aware, direction-aware, and anchored to a stable active event; raw delta cursors remain separate. The change does not add a projection, offset scan, schema version, or alterchat.history.The shipped numeric HTTP cursor remains accepted for one upgrade window. Unsupported fallback reads preserve the caller's cursor instead of silently restarting the page.
User Impact
Operators with deep session histories receive small HTTP history pages and SSE refreshes with bounded work. New appends do not invalidate paging toward older messages, while branch replacement or generation changes reset the visible snapshot instead of continuing from a stale anchor.
Evidence
Correctness and validation
pnpm check:changedpassed formatting, boundary/API guards, core and test typechecks, lint, database-first guards, and import-cycle checks.e84b451c93dfce204ff049924be0538b6ab0b6d4reproduces 10 stale sequence-value assertions in the full HTTP test file. The child-specific cursor, replacement, append, compatibility, and SSE cases pass, and this child preserves the parent's actual wire sequence semantics.Apples-to-apples benchmark
Same Blacksmith machine (
ip-172-31-64-123), Linux x64, Nodev24.18.0; deterministic 100,000-event linear active assistant transcript; 64-character text; page size 50; raw window 1,020; 3 warmups; 12 measured runs. Both sides exercise the production HTTP handler and SSE state owner using the same measurement code.Baseline: current
origin/mainatc1b78839e288936bd165dc8932fabfee8af7543cCandidate:
7bc4bbec59cb45be5b74fe000605074debbbde86Median RSS delta was 14,725,120 B (HTTP) and 10,866,688 B (SSE) on main versus 0 B in both candidate scenarios. Process peak RSS was 645,916 KiB on main and 609,732 KiB on the candidate.
EXPLAIN QUERY PLANon the candidate reports:No full transcript scan or temporary B-tree is used. Raw benchmark output is reproducible with: