fix(server): preserve provider history across repeated rollbacks - #12676
Merged
juliusmarminge merged 1 commit intoSep 21, 2026
Conversation
Contributor
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This focused rollback bug fix filters stale turns from already-rolled-back runs while retaining the durable audit history, preventing repeated rollbacks from acting on provider entries that no longer exist. It includes a targeted regression test and does not alter schemas, defaults, configuration, or deployment behavior. You can add or adjust custom eligibility rules. Learn more. |
2 tasks
juliusmarminge
force-pushed
the
t3code/codex-turn-mapping
branch
2 times, most recently
from
September 21, 2026 05:40
a1f8051 to
0337dd6
Compare
juliusmarminge
force-pushed
the
fix/repeated-checkpoint-rollback
branch
from
September 21, 2026 20:10
82396a6 to
8e4829f
Compare
juliusmarminge
merged commit Sep 21, 2026
3853888
into
pingdotgg:t3code/codex-turn-mapping
21 checks passed
juliusmarminge
pushed a commit
that referenced
this pull request
Sep 23, 2026
juliusmarminge
pushed a commit
that referenced
this pull request
Sep 23, 2026
juliusmarminge
pushed a commit
that referenced
this pull request
Sep 23, 2026
juliusmarminge
pushed a commit
that referenced
this pull request
Sep 23, 2026
juliusmarminge
pushed a commit
that referenced
this pull request
Sep 23, 2026
juliusmarminge
pushed a commit
that referenced
this pull request
Sep 23, 2026
juliusmarminge
pushed a commit
that referenced
this pull request
Sep 24, 2026
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.
What Changed
Exclude turns from already rolled-back runs when preparing a provider rollback. The audit history stays intact, and the existing rollback test now covers a previous rewind and both rollback targets.
Targets the orchestration V2 branch from #2829.
Fixes #12679.
Why
In a Codex legacy-history thread with turns A, B, C, rewinding to B and then A makes Codex discard A too: T3 still shows one completed turn, but the provider has none. The second rollback incorrectly counts C again even though it was already removed.
Pi hits the same stale-history problem after rewinding to A, adding D, and rewinding to A again: it tries to fork at an already-removed entry. Filtering those turns makes both providers use the current conversation.
Validation
CheckpointRollbackService.test.tspass with it.gpt-6-astra). Legacy-history baseline: 3 → 2 → 0 native turns. Fixed: 3 → 2 → 1 → 2 → 1, with matching files and retained turn IDs. All three fixed rollback receipts succeed on the first attempt.The isolated test launcher explicitly requests the supported
thread/start.historyMode: "legacy"; all other requests pass unchanged to Codex 0.155.1. Default new sessions use paginated history and hit a separate V2 adapter rejection on the first rewind, before this repeated-rollback bug can be exercised.Reproduction
New recording: Codex CLI 0.155.1, GPT-6 Astra, legacy history, original rollback implementation. After the second rewind, T3 retains A while the native provider history is empty.
repeated-rollback-0.155.1-astra.mp4
Checklist
Built and verified with GPT-6 Astra in Codex CLI 0.155.1.