Repository navigation
fix: agent stops replying when a session transcript has no header row - #115080
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 28, 2026, 11:44 AM ET / 15:44 UTC. ClawSweeper reviewWhat this changesThe PR recognizes headerless but otherwise canonical SQLite session transcripts as current data, preserves their event identity at runtime, and adds a Doctor repair that prepends a header while rebuilding transcript projections. Merge readinessThis is an active, focused regression repair with convincing real-database evidence, but it changes durable session admission and adds a Doctor-owned SQLite rewrite. It should remain open for explicit maintainer approval and completion of the currently failing documentation/lint checks rather than being cleaned up or auto-closed. Priority: P1 Review scores
Verification
How this fits togetherOpenClaw loads an agent’s SQLite transcript before an inbound channel message can run the agent. The session loader either accepts a canonical transcript, routes legacy data to Doctor, or initializes an empty session; Doctor can then repair persistent transcript state and its derived indexes. flowchart TD
A[Inbound channel message] --> B[SQLite transcript loader]
B --> C{Header and event shape}
C -->|Canonical but headerless| D[Use current in-memory header]
C -->|Legacy or malformed| E[Doctor diagnostic]
C -->|Physically empty| F[Initialize new session]
D --> G[Agent reply]
E --> H[Guarded SQLite transcript repair]
H --> B
Decision needed
Why: The runtime classification is narrowly scoped, but the new behavior also transactionally rewrites durable transcript data and affects session recency and derived indexes; this persistence policy needs explicit owner approval. Before merge
Agent review detailsSecurityNone. PR surfaceSource +456, Tests +366, Docs +7. Total +829 across 9 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep runtime strict for malformed or genuinely legacy transcripts, accept only fully canonical headerless rows, and land the Doctor repair once a maintainer confirms its persisted-state contract and the refreshed branch has the required checks green. Do we have a high-confidence way to reproduce the issue? Yes, at source level: a SQLite transcript with canonical event rows but no session header takes the legacy rejection path described by the PR, and the contributor supplied redacted after-fix output from a real affected database. I did not independently execute the reproduction in this read-only review. Is this the best way to solve the issue? Yes, conditionally: keeping runtime strict for legacy-shaped rows while putting the physical header rewrite in Doctor matches the repository’s canonical-runtime and migration ownership rules. Maintainer approval is still needed because the Doctor path rewrites persisted session data. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against cbe19ed3be23. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
96785b0 to
60be910
Compare
…gacy Sessions whose SQLite transcript has no session header row were treated as version 1 and hard-failed every run with "Persisted legacy session transcripts require doctor/import migration before runtime use". Only an actual header now declares a legacy version. Co-authored-by: Copilot <[email protected]>
Rebuild the header at the current version instead of inferring v1, and route header-less transcripts that still hold legacy-shaped entries to doctor. Co-authored-by: Copilot <[email protected]>
60be910 to
cbba8f0
Compare
|
Merged via squash.
|
* origin/main: (61 commits) perf(ui): debounce event-driven session list refreshes and right-size child paging (openclaw#115374) feat(talk): support GPT-Live realtime voice over ChatGPT OAuth (openclaw#115226) feat(system-agent): guide gateway configuration in Ask OpenClaw (openclaw#115363) fix(agents): make overflow recovery append-only via branch-and-reappend (openclaw#115271) (openclaw#115310) fix(macos): bound websocket ping so a dropped pong cannot orphan its continuation (openclaw#115362) fix(codex): isolate native hook relay startup (openclaw#115078) fix(ci): stop reviving superseded pull request workflows (openclaw#115378) feat(openshell): add workspace selection (openclaw#114952) fix(skills): persist workshop apply reason; correct Skill Workshop docs (openclaw#114471) fix: agent stops replying when a session transcript has no header row (openclaw#115080) perf(usage): stale-while-revalidate caches for usage.status and sessions.usage (openclaw#115369) fix(discord): reject invalid UTF-8 probe responses (openclaw#111734) feat(gateway): add memory.search operator method (openclaw#115346) fix(android): keep welcome action reachable with large text (openclaw#111747) fix(gateway): validate doctor memory agent ids (openclaw#115365) refactor: harden shell completion and shard Control UI E2E (openclaw#115332) fix(ui): anchor the thread branches menu to its trigger button (openclaw#115352) perf(sessions): incremental snapshot revalidation and shallow list projections (openclaw#115359) refactor(sessions): consolidate entry state (openclaw#115299) feat(ui): swap three plain Lobsterdex palettes for balloon, ascii, and portal (openclaw#115308) ...
…openclaw#115080) * fix(sessions): stop rejecting header-less persisted transcripts as legacy Sessions whose SQLite transcript has no session header row were treated as version 1 and hard-failed every run with "Persisted legacy session transcripts require doctor/import migration before runtime use". Only an actual header now declares a legacy version. Co-authored-by: Copilot <[email protected]> * fix(sessions): keep entry ids stable for header-less transcripts Rebuild the header at the current version instead of inferring v1, and route header-less transcripts that still hold legacy-shaped entries to doctor. Co-authored-by: Copilot <[email protected]> * fix(sessions): repair headerless transcripts in doctor --------- Co-authored-by: Galin Iliev <[email protected]> Co-authored-by: Copilot <[email protected]>
) * fix(sessions): stop resets from wedging never-materialized session transcripts A /new or daily reset against a session entry whose SQLite transcript had no rows appended the reset boundary at seq 0 with no session header. Every later load then classified the transcript as legacy v1 and failed the session lane on each turn, while the group silent-reply policy swallowed the generic failure text - the bot showed typing, then nothing, forever. - buildSessionResetBoundaryEvent builds no boundary when the transcript has nothing to reset; both lifecycle call sites share one owner helper. - Loads distinguish headerless transcripts from legacy versions and point at "openclaw doctor --fix", which actually repairs that state (#115080). - Transcript-repair load failures are classified as actionable rather than generic, so the repair notice stays visible in group chats instead of being silenced to NO_REPLY. * test(auto-reply): materialize transcripts in reset-authorization fixtures The durable-reset assertions seeded a session entry with zero transcript rows and asserted the reset boundary landed there - exactly the headerless seq-0 corruption the parent fix removes. Seed one message first so an allowed reset still proves a durable boundary on a real conversation. Co-authored-by: izshaw <[email protected]>
…claw#135253) * fix(sessions): stop resets from wedging never-materialized session transcripts A /new or daily reset against a session entry whose SQLite transcript had no rows appended the reset boundary at seq 0 with no session header. Every later load then classified the transcript as legacy v1 and failed the session lane on each turn, while the group silent-reply policy swallowed the generic failure text - the bot showed typing, then nothing, forever. - buildSessionResetBoundaryEvent builds no boundary when the transcript has nothing to reset; both lifecycle call sites share one owner helper. - Loads distinguish headerless transcripts from legacy versions and point at "openclaw doctor --fix", which actually repairs that state (openclaw#115080). - Transcript-repair load failures are classified as actionable rather than generic, so the repair notice stays visible in group chats instead of being silenced to NO_REPLY. * test(auto-reply): materialize transcripts in reset-authorization fixtures The durable-reset assertions seeded a session entry with zero transcript rows and asserted the reset boundary landed there - exactly the headerless seq-0 corruption the parent fix removes. Seed one message first so an allowed reset still proves a durable boundary on a real conversation. Co-authored-by: izshaw <[email protected]>
What Problem This Solves
Fixes an issue where an agent would stop replying when its current SQLite
session transcript contained canonical conversation events but no initial
type: "session"header row. Every inbound message then failed withPersisted legacy session transcripts require doctor/import migration before runtime use,while
openclaw doctoroffered no repair.The state was observed in a real channel-bound session with 11 canonical events
and no header. It also breaks consumers that require the persisted header,
including Codex history replay, manual compaction, and trajectory export.
Why This Change Was Made
Runtime remains strict: only a physically empty transcript may initialize
lazily, while any persisted headerless or legacy-shaped transcript continues to
fail closed.
openclaw doctornow detects headerless transcripts only when allknown rows already satisfy the current schema, and
openclaw doctor --fixrepairs them at the storage owner boundary.
The repair first takes a read-only snapshot, then re-reads and revalidates the
authoritative rows and session binding inside one synchronous SQLite
transaction. It prepends a current header, rewrites and reindexes the transcript,
rotates its generation, and preserves existing event IDs, parent links, row
timestamps, and session-list recency. Malformed, duplicate-identity, or legacy
rows remain untouched. No schema change is required.
User Impact
openclaw doctornow identifies affected sessions and tells operators to runopenclaw doctor --fix. After repair, the agent can resume with its existingconversation history instead of failing every turn. Existing canonical event
identity and branching state remain stable.
Evidence
Focused real-SQLite integration coverage in
src/commands/doctor-session-transcript-headers.test.tsverifies:--fixprepends a current header and preserves IDs, parent links, rowtimestamps, and sequence order;
time;
cwdcomes from the owning session only, with the configured agentworkspace as fallback.
CI is green for head
cbba8f0a684b9df28676567b45c81ab9fa29b987, includingopenclaw/ci-gate,check-docs,check-lint, the SQLite session schema andflip-proof gates, and the session transcript/accessor boundary checks:
https://github.com/openclaw/openclaw/actions/runs/30382661735
Proof gap: no separate packaged or Docker end-to-end lane was run; the final
repair path is covered by the focused SQLite integration test and full PR CI.