From 4a21f888e86e202b0aa9aa8bf8773aafa93244d7 Mon Sep 17 00:00:00 2001 From: Charles Cunningham Date: Sat, 21 Feb 2026 21:42:28 -0800 Subject: [PATCH] core: avoid previous-model updates in task wrapper --- codex-rs/core/src/tasks/mod.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/codex-rs/core/src/tasks/mod.rs b/codex-rs/core/src/tasks/mod.rs index 74921c8140..367e72869b 100644 --- a/codex-rs/core/src/tasks/mod.rs +++ b/codex-rs/core/src/tasks/mod.rs @@ -144,7 +144,6 @@ impl Session { tokio::spawn( async move { let ctx_for_finish = Arc::clone(&ctx); - let model_slug = ctx_for_finish.model_info.slug.clone(); let TaskRunOutput { last_agent_message, abort_reason, @@ -158,9 +157,6 @@ impl Session { .await; let sess = session_ctx.clone_session(); sess.flush_rollout().await; - // Update previous model before TurnComplete is emitted so - // immediately following turns observe the correct switch state. - sess.set_previous_model(Some(model_slug)).await; if let Some(reason) = abort_reason { ctx_for_finish .turn_metadata_state