Repository navigation
feat: bound transcript reads across replacements - #110374
Conversation
|
Codex review: found issues before merge. Reviewed July 18, 2026, 2:38 PM ET / 18:38 UTC. Summary PR surface: Source +747, Tests +862, Docs +4, Config 0, Generated +14, Other +191. Total +1818 across 32 files. Reproducibility: not applicable. This PR adds a new bounded transcript cursor capability rather than fixing a currently documented failing behavior. The supplied lifecycle and benchmark evidence is useful implementation proof, but it is not a current-main bug reproduction. Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review findings
Review detailsBest possible solution: Keep bounded active-memory reading narrowly owned for now, and split any durable generation-backed public cursor API into a maintainer-sponsored design that uses the repository’s additive-table migration policy and defines the permanent Plugin SDK contract. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR adds a new bounded transcript cursor capability rather than fixing a currently documented failing behavior. The supplied lifecycle and benchmark evidence is useful implementation proof, but it is not a current-main bug reproduction. Is this the best way to solve the issue? No: bounded reads are a valid goal, but the branch is not yet the best solution because it commits to a public Plugin SDK and a schema-version migration before maintainers choose that platform direction. A narrower owner-local read path or a sponsored API design is safer. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1ca6b6ff6722. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +747, Tests +862, Docs +4, Config 0, Generated +14, Other +191. Total +1818 across 32 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 (10 earlier review cycles; latest 8 shown)
|
e84b451 to
b628667
Compare
cf8eeb1 to
7ff4bab
Compare
9d744d0 to
90b909d
Compare
Refs clawdbot-d02.1.9.1.40-db6.1
Refs clawdbot-d02.1.9.1.40-db6.2
Refs clawdbot-d02.1.9.1.40-db6.3
Refs clawdbot-d02.1.9.1.40-db6.4
Refs clawdbot-d02.1.9.1.40-db6.5
cb90b46 to
69e4633
Compare
AI-assisted: implementation, tests, and review were completed with Codex; the author understands and validated the change.
What Problem This Solves
Transcript consumers currently must load complete transcripts or treat sequence numbers as resumable watermarks. Sequence numbers become ambiguous when a transcript is destructively replaced and resequenced from zero, while full reads create avoidable allocation and latency on large transcripts. Context engines also need branch-safe visible messages without independently reconstructing OpenClaw's transcript tree.
Why This Change Was Made
This adds the smallest generation-aware foundation: schema v13 stores one durable token for each materialized raw transcript, append preserves it, and destructive replacement rotates it. Bounded Plugin SDK reads expose separate raw-event and visible-message cursor contracts. Both limit pages by count and stored JSONL bytes; the visible cursor reuses the existing materialized active projection and reports typed reset or projection-unavailable outcomes. The only production adopter remains optional active-memory transcript inspection. Codex/Copilot mirrors, core HTTP/SSE history, transcript repair, and complete-artifact recall remain unchanged.
Changes walkthrough
src/state/openclaw-agent-schema.sqlsrc/state/openclaw-agent-db.tssrc/config/sessions/session-accessor.sqlite-transcript-state.tssrc/config/sessions/session-accessor.sqlite-delta.tssrc/config/sessions/session-accessor.sqlite-active-events.tssrc/config/sessions/session-accessor.*src/plugin-sdk/session-transcript-runtime.tsextensions/active-memory/transcript.tssrc/**/*.test.tsscripts/bench-transcript-cursors.tsdocs/plugins/*User Impact
Plugin developers can resume bounded raw transcript reads across appends and receive an explicit reset after replacement. Context engines can independently consume bounded, branch-safe visible messages from oldest to newest, persist an opaque cursor, resume linear appends, and rebuild on a typed reset without duplicating active-branch rules. A rebuilding projection returns a typed unavailable result. Active-memory inspection no longer materializes a complete raw transcript before applying its limits. Core session restoration and user-facing history behavior do not change.
Evidence
git diff --checkpass.pnpm check:changedpasses on Blacksmith Testbox, including schema/API generation, SDK budgets, full typecheck, lint, database-first guards, and import-cycle checks.100k-event benchmark on Blacksmith Testbox, 12 runs:
Explicit follow-ups, not part of this PR: indexed fact helpers with concrete callers, visible HTTP/SSE keyset pagination, and any further internal caller adoption.