diff --git a/crates/goose-cli/src/cli.rs b/crates/goose-cli/src/cli.rs index 986b9e0873ba..ba38ce92250b 100644 --- a/crates/goose-cli/src/cli.rs +++ b/crates/goose-cli/src/cli.rs @@ -174,6 +174,12 @@ pub struct ExtensionOptions { value_delimiter = ',' )] pub builtins: Vec, + + #[arg( + long = "no-profile", + help = "Don't load your default extensions, only use CLI-specified extensions" + )] + pub no_profile: bool, } /// Input source and recipe options for the run command @@ -1156,6 +1162,7 @@ async fn handle_interactive_session( extensions: extension_opts.extensions, streamable_http_extensions: extension_opts.streamable_http_extensions, builtins: extension_opts.builtins, + no_profile: extension_opts.no_profile, recipe: None, additional_system_prompt: None, provider: None, @@ -1360,6 +1367,7 @@ async fn handle_run_command( extensions: extension_opts.extensions, streamable_http_extensions: extension_opts.streamable_http_extensions, builtins: extension_opts.builtins, + no_profile: extension_opts.no_profile, recipe: recipe.clone(), additional_system_prompt: input_config.additional_system_prompt, provider: model_opts.provider, @@ -1486,6 +1494,7 @@ async fn handle_default_session() -> Result<()> { extensions: Vec::new(), streamable_http_extensions: Vec::new(), builtins: Vec::new(), + no_profile: false, recipe: None, additional_system_prompt: None, provider: None, diff --git a/crates/goose-cli/src/commands/bench.rs b/crates/goose-cli/src/commands/bench.rs index cf682c9307a6..e70636608110 100644 --- a/crates/goose-cli/src/commands/bench.rs +++ b/crates/goose-cli/src/commands/bench.rs @@ -51,6 +51,7 @@ pub async fn agent_generator( extensions: requirements.external, streamable_http_extensions, builtins: requirements.builtin, + no_profile: true, recipe: None, additional_system_prompt: None, provider: None, diff --git a/crates/goose-cli/src/session/builder.rs b/crates/goose-cli/src/session/builder.rs index 18f94375e060..e31c0b0209be 100644 --- a/crates/goose-cli/src/session/builder.rs +++ b/crates/goose-cli/src/session/builder.rs @@ -92,6 +92,7 @@ pub struct SessionBuilderConfig { pub streamable_http_extensions: Vec, /// List of builtin extension commands to add pub builtins: Vec, + pub no_profile: bool, /// Recipe for the session pub recipe: Option, /// Any additional system prompt to append to the default @@ -130,6 +131,7 @@ impl Default for SessionBuilderConfig { extensions: Vec::new(), streamable_http_extensions: Vec::new(), builtins: Vec::new(), + no_profile: false, recipe: None, additional_system_prompt: None, provider: None, @@ -529,6 +531,8 @@ pub async fn build_session(session_config: SessionBuilderConfig) -> CliSession { .and_then(|s| EnabledExtensionsState::from_extension_data(&s.extension_data)) .map(|state| state.extensions) .unwrap_or_else(get_enabled_extensions) + } else if session_config.no_profile { + Vec::new() } else { resolve_extensions_for_new_session(recipe.and_then(|r| r.extensions.as_deref()), None) }; @@ -636,6 +640,7 @@ mod tests { timeout: goose::config::DEFAULT_EXTENSION_TIMEOUT, }], builtins: vec!["developer".to_string()], + no_profile: false, recipe: None, additional_system_prompt: Some("Test prompt".to_string()), provider: None, @@ -671,6 +676,7 @@ mod tests { assert!(config.extensions.is_empty()); assert!(config.streamable_http_extensions.is_empty()); assert!(config.builtins.is_empty()); + assert!(!config.no_profile); assert!(config.recipe.is_none()); assert!(config.additional_system_prompt.is_none()); assert!(!config.debug);