diff --git a/codex-rs/core/src/codex.rs b/codex-rs/core/src/codex.rs index 4f953064c9..3d522f248d 100644 --- a/codex-rs/core/src/codex.rs +++ b/codex-rs/core/src/codex.rs @@ -516,7 +516,7 @@ impl AgentTask { } async fn submission_loop( - mut session_id: Uuid, + session_id: Uuid, config: Arc, rx_sub: Receiver, tx_event: Sender, @@ -595,12 +595,11 @@ async fn submission_loop( let RolloutSetup { recorder: rollout_recorder, restored_items, - restored_prev_id, session_id, } = crate::rollout::prepare_rollout_recorder( &config, session_id, - instructions.clone(), + user_instructions.clone(), resume_path.as_deref(), ) .await; diff --git a/codex-rs/core/src/rollout.rs b/codex-rs/core/src/rollout.rs index d995788bab..71f87d746a 100644 --- a/codex-rs/core/src/rollout.rs +++ b/codex-rs/core/src/rollout.rs @@ -46,7 +46,6 @@ pub struct SavedSession { pub struct RolloutSetup { pub recorder: Option, pub restored_items: Option>, - pub restored_prev_id: Option, pub session_id: Uuid, } @@ -323,18 +322,16 @@ async fn rollout_writer( pub async fn prepare_rollout_recorder( config: &Config, - mut session_id: Uuid, + session_id: Uuid, instructions: Option, resume_path: Option<&Path>, ) -> RolloutSetup { // Try to resume - let (mut restored_items, mut restored_prev_id, mut recorder_opt) = (None, None, None); + let (mut restored_items, mut recorder_opt) = (None, None); if let Some(path) = resume_path { match RolloutRecorder::resume(path).await { Ok((rec, saved)) => { - session_id = saved.session_id; - restored_prev_id = saved.state.previous_response_id; if !saved.items.is_empty() { restored_items = Some(saved.items); } @@ -359,7 +356,6 @@ pub async fn prepare_rollout_recorder( RolloutSetup { recorder: recorder_opt, restored_items, - restored_prev_id, session_id, } }