diff --git a/codex-rs/core/src/codex/rollout_reconstruction.rs b/codex-rs/core/src/codex/rollout_reconstruction.rs index e8e9c730c8..928afe4b9d 100644 --- a/codex-rs/core/src/codex/rollout_reconstruction.rs +++ b/codex-rs/core/src/codex/rollout_reconstruction.rs @@ -170,6 +170,9 @@ impl Session { active_segment.turn_id.as_deref(), ctx.turn_id.as_deref(), ) { + // Reverse replay walks newest-to-oldest, so the first surviving + // `TurnContextItem` we see for this turn segment is the newest + // surviving context snapshot for the turn. if active_segment.previous_turn_settings.is_none() { active_segment.previous_turn_settings = Some(PreviousTurnSettings { model: ctx.model.clone(),