Sessions required (#5548)

Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
Douwe Osinga
2025-11-03 21:04:44 -05:00
committed by GitHub
parent 86c3e42e43
commit 5b93ee587f
31 changed files with 956 additions and 2678 deletions
@@ -2,7 +2,7 @@ use crate::agents::ExtensionConfig;
use crate::providers::base::Provider;
use std::env;
use std::fmt;
use std::path::PathBuf;
use std::path::{Path, PathBuf};
use std::sync::Arc;
/// Default maximum number of turns for task execution
@@ -15,7 +15,7 @@ pub const GOOSE_SUBAGENT_MAX_TURNS_ENV_VAR: &str = "GOOSE_SUBAGENT_MAX_TURNS";
#[derive(Clone)]
pub struct TaskConfig {
pub provider: Arc<dyn Provider>,
pub parent_session_id: Option<String>,
pub parent_session_id: String,
pub parent_working_dir: PathBuf,
pub extensions: Vec<ExtensionConfig>,
pub max_turns: Option<usize>,
@@ -34,17 +34,16 @@ impl fmt::Debug for TaskConfig {
}
impl TaskConfig {
/// Create a new TaskConfig with all required dependencies
pub fn new(
provider: Arc<dyn Provider>,
parent_session_id: Option<String>,
parent_working_dir: PathBuf,
parent_session_id: &str,
parent_working_dir: &Path,
extensions: Vec<ExtensionConfig>,
) -> Self {
Self {
provider,
parent_session_id,
parent_working_dir,
parent_session_id: parent_session_id.to_owned(),
parent_working_dir: parent_working_dir.to_owned(),
extensions,
max_turns: Some(
env::var(GOOSE_SUBAGENT_MAX_TURNS_ENV_VAR)