Repository navigation
fix(sessions): keep accepted input active during transcript rewrites - #138967
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: blocked before merge. Reviewed September 5, 2026, 4:38 AM ET / 08:38 UTC. ClawSweeper reviewWhat this changesKeeps accepted user input on the active transcript when history maintenance copies messages to new entries, with regression coverage for replay and ownership. Merge readiness⛔ Blocked before merge - 1 item remains This remains a useful repair: current main and the latest release lack accepted-input relocation, and the linked merged repairs address different failures. No blocking introduced defect was found. Priority: P1 Review scores
Verification
How this fits togetherOpenClaw stages accepted chat input before the agent processes it. Transcript maintenance copies conversation history into a new branch, and input custody must follow the committed copy so retries recognize the same accepted message. flowchart LR
A[Accepted chat input] --> B[Live input owner]
B --> C[Persisted user message]
C --> D[History rewrite]
B --> E[Validate exact relocation]
D --> E
E --> F[SQLite commit]
F --> G[Updated transcript location]
G --> H[Replay existing message]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +60, Tests +176. Total +236 across 7 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep immutable admission identity separate from the commit-published transcript location; the additional scoped state preserves ownership without changing stored formats. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the path: promote accepted input, rewrite an earlier entry, then replay the accepted user against its old entry ID. The PR reports failing base cases; this read-only review did not execute them. Is this the best way to solve the issue? Yes. Updating location at the existing custody and commit boundaries preserves exact replay checks; resolving by idempotency key alone would lose the distinction between authorized relocation and an unrelated replacement branch. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against bf90b12fe515. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
|
The complementary atomic transcript-publication repair #138984 has merged as b0ae5b6. It retains the existing accepted-input authority and transaction-local relocation behavior while publishing the replacement history coherently. Recorded regression coverage includes active versus closed/replaced admission, rejection before durable changes, input custody, and reader agreement after rewrites. This is follow-through on the shared transcript lifecycle, not a claim that the earlier input-ownership repair was unnecessary or replaced. |
What Problem This Solves
Fixes an issue where an accepted chat message could disappear from the active transcript and fail with
Pending input is no longer active in its admitted transcriptwhen maintenance rewrote earlier history during the same turn.Why This Change Was Made
Transcript rewrites create new event IDs for the copied active suffix, but accepted-input custody remained bound to the old event ID. This change keeps immutable request identity separate from the current transcript location. Only the exact keyed user owned by the live admitted turn may move that location, and the move becomes visible only after the SQLite rewrite commits.
The existing inactive-branch, ownership, and idempotency checks remain in force. This does not add a generic retry, change schemas, alter provider behavior, or weaken the keyed-turn safety checks.
User Impact
Accepted chat input remains visible and replayable when transcript maintenance truncates or replaces earlier history. Direct and collected inputs both retain one active user entry through repeated rewrites, including context-excluded inputs.
Evidence
961464a5177e02cf037b7783fed0dc842619f16d: all four synthetic direct/collected and context-exclusion variants fail with the exact admitted-transcript error.3da9a361da67cad12fae63c116f2503f34a04644: all four variants pass, including repeated rewrites, replay against the relocated event ID, and closed-owner terminal replay.OPENCLAW_TESTBOX=1 pnpm check:changed: passed on the exact head in Testbox.The merged keyed-compaction repair #133094 and accepted-send retry repair #137267 are both present in the reproduced base. Neither covers event-ID relocation during a transcript rewrite.
Worked on by