Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions crates/goose/src/recipe/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,31 @@ pub struct RecipeBuilder {
}

impl Recipe {
/// When a recipe has the old builtin developer extension but not analyze, auto-inject analyze.
fn ensure_analyze_for_developer(&mut self) {
let has_builtin_developer = self.extensions.as_ref().is_some_and(|exts| {
exts.iter()
.any(|e| matches!(e, ExtensionConfig::Builtin { name, .. } if name == "developer"))
});
let has_analyze = self
.extensions
.as_ref()
.is_some_and(|exts| exts.iter().any(|e| e.name() == "analyze"));

if has_builtin_developer && !has_analyze {
let analyze = ExtensionConfig::Platform {
name: "analyze".to_string(),
description: String::new(),
display_name: None,
bundled: None,
available_tools: vec![],
Comment on lines +242 to +246
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve tool allowlist when auto-adding analyze

When analyze is auto-injected here, it is created with available_tools: vec![], which means “all tools allowed” per ExtensionConfig::is_tool_available in crates/goose/src/agents/extension.rs. For legacy recipes that intentionally restrict developer via a non-empty available_tools list, this change re-exposes analyze capabilities that were previously filtered out, so the compatibility path can unintentionally bypass a recipe’s tool-scoping constraints.

Useful? React with 👍 / 👎.

};
if let Some(exts) = &mut self.extensions {
exts.push(analyze);
}
}
}

fn ensure_summon_for_subrecipes(&mut self) {
if self.sub_recipes.is_none() {
return;
Expand Down Expand Up @@ -309,6 +334,7 @@ impl Recipe {
.map_err(|e| anyhow::anyhow!("{}", strip_error_location(&e.to_string())))?,
};

recipe.ensure_analyze_for_developer();
recipe.ensure_summon_for_subrecipes();
Ok(recipe)
}
Expand Down
Loading