Unify subrecipe and subagent execution through shared recipe pipeline (#5082)

This commit is contained in:
tlongwell-block
2025-11-06 19:02:03 -05:00
committed by GitHub
parent 3bf769edfe
commit 20ba2fdb7e
22 changed files with 261 additions and 616 deletions
@@ -155,15 +155,13 @@ pub async fn apply_recipe_to_agent(
recipe: &Recipe,
include_final_output_tool: bool,
) -> Option<String> {
if let Some(sub_recipes) = &recipe.sub_recipes {
agent.add_sub_recipes(sub_recipes.clone()).await;
}
if include_final_output_tool {
if let Some(response) = &recipe.response {
agent.add_final_output_tool(response.clone()).await;
}
}
agent
.apply_recipe_components(
recipe.sub_recipes.clone(),
recipe.response.clone(),
include_final_output_tool,
)
.await;
recipe.instructions.as_ref().map(|instructions| {
let mut context: HashMap<&str, Value> = HashMap::new();