This commit is contained in:
Ahmed Ibrahim
2025-07-23 14:54:49 -07:00
parent 3b130f3b39
commit dbc7bc9f3a
2 changed files with 4 additions and 9 deletions
+2 -3
View File
@@ -516,7 +516,7 @@ impl AgentTask {
}
async fn submission_loop(
mut session_id: Uuid,
session_id: Uuid,
config: Arc<Config>,
rx_sub: Receiver<Submission>,
tx_event: Sender<Event>,
@@ -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;
+2 -6
View File
@@ -46,7 +46,6 @@ pub struct SavedSession {
pub struct RolloutSetup {
pub recorder: Option<RolloutRecorder>,
pub restored_items: Option<Vec<ResponseItem>>,
pub restored_prev_id: Option<String>,
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<String>,
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,
}
}