feat: Adds max_turns for the agent without user input (#3208)

This commit is contained in:
Jarrod Sibbison
2025-07-03 11:57:25 +10:00
committed by GitHub
parent cf818ada89
commit 2c86a0eb6e
13 changed files with 284 additions and 2 deletions
+4
View File
@@ -52,6 +52,7 @@ pub struct Session {
debug: bool, // New field for debug mode
run_mode: RunMode,
scheduled_job_id: Option<String>, // ID of the scheduled job that triggered this session
max_turns: Option<u32>,
}
// Cache structure for completion data
@@ -113,6 +114,7 @@ impl Session {
session_file: Option<PathBuf>,
debug: bool,
scheduled_job_id: Option<String>,
max_turns: Option<u32>,
) -> Self {
let messages = if let Some(session_file) = &session_file {
match session::read_messages(session_file) {
@@ -135,6 +137,7 @@ impl Session {
debug,
run_mode: RunMode::Normal,
scheduled_job_id,
max_turns,
}
}
@@ -757,6 +760,7 @@ impl Session {
.expect("failed to get current session working directory"),
schedule_id: self.scheduled_job_id.clone(),
execution_mode: None,
max_turns: self.max_turns,
}
});
let mut stream = self