Skip subagents for gemini (#5257)

Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
Douwe Osinga
2025-10-18 17:35:29 -04:00
committed by GitHub
parent 890393bb68
commit 64b37339e0
12 changed files with 156 additions and 298 deletions
@@ -27,6 +27,7 @@ pub struct CreateDynamicTaskParams {
/// How to execute multiple tasks (default: parallel for multiple tasks, sequential for single task)
#[serde(skip_serializing_if = "Option::is_none")]
#[schemars(with = "Option<String>")]
pub execution_mode: Option<ExecutionModeParam>,
}
@@ -90,6 +91,18 @@ pub struct TaskParameter {
pub return_last_only: Option<bool>,
}
pub fn should_enabled_subagents(model_name: &str) -> bool {
let config = crate::config::Config::global();
let is_autonomous = config.get_param("GOOSE_MODE").unwrap_or("auto".to_string()) == "auto";
if !is_autonomous {
return false;
}
if model_name.starts_with("gemini") {
return false;
}
true
}
pub fn create_dynamic_task_tool() -> Tool {
let schema = schema_for!(CreateDynamicTaskParams);
let schema_value =