Repository navigation
fix(codex): keep same-run retries working after accepted steering - #10
Merged
Merged
Conversation
Accepting a steer stamps its target run on the steer row, which rotates the transcript generation. A transient same-model retry then reran the Codex attempt with the original recorder, and its fenced history reread failed with "Current-turn transcript admission identity changed", dropping the reply. The fenced read ends before the admission, so the first attempt's snapshot is what a reread would return. Retain it per recorder and reuse it for a same-scope retry, mirroring the Agents API fix (openclaw#161444 upstream). Context-engine bootstrap/assembly still fail closed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Long Codex turns that were steered mid-run failed with
Current-turn transcript admission identity changed: <entryId>(SessionTranscriptReadFenceError). The work was done, but no reply was delivered. On the live Gateway this happened twice on 2026-10-02, after a 103-minute turn and a 10-minute turn in the same Control UI session.Sequence, from the journal and the transcript rows:
reply-run-registry.message-injection.tscallsconfirmSteerTargetRunIdForPersistence, which rewrites the steer row and rotates the transcript generation.byte_limit/provenance_rejected).transient same-model retry 1/8 … reason=overloadedreruns the Codex attempt with the same run and the original recorder.prepareCodexAttemptContext→readFencedHistoryrereads through the original, now-stale admission, and the fence throws.Fix
The fenced read ends before the admission and excludes this run's own results, so the first attempt's snapshot is exactly what a reread would return. Retain it per recorder (a WeakMap, lifetime of one logical run) and reuse it for a retry with the same scope: run, admission entry, agent, session id/key/file, store path and context budget. Any other scope rereads and still fails closed on a stale admission. This mirrors upstream's Agents API fix (openclaw#161444). Upstream has no equivalent for Codex yet. The core producer fixes (openclaw#161315, openclaw#160908) are unmerged drafts.
Known gaps, both left alone on purpose:
Evidence
run-attempt.steering-settlement.test.tsdrives a real recorder, an accepted native steer, the registry'sconfirmSteerTargetRunIdForPersistence, a failed turn, then a same-run rerun. Without the fix it fails with the exact production error atrun-attempt-context.tsreadFencedHistory. With the fix it passes, and the retry reachesturn/startand completes.pnpm exec vitest run … --maxWorkers=1.pnpm tsgo:extensionsandpnpm tsgo:extensions:testare clean, oxlint is clean, andgit diff --checkis clean.🤖 Generated with Claude Code