Unify subrecipe and subagent execution through shared recipe pipeline
Replaces subprocess-based subrecipe execution with in-process transformation, unifying the execution path between subrecipes and subagents while bringing full Recipe feature support to subagents.
What Changed
- Subrecipes now execute in-process instead of spawning
goose run --recipe - Removed TaskType enum - both subrecipes and inline recipes are just recipes
- Unified execution through single
run_complete_subagent_task()path - Added ModelOverrideProvider for recipe-specific model configuration
Backend Changes for Subrecipes
Subrecipes previously spawned a subprocess (goose run --recipe) which naturally supported all Recipe features. Now they:
- Load and build recipes directly at task creation time
- Execute through the same in-process pipeline as subagents
- Eliminate 170+ lines of subprocess management code
- Run faster without process overhead
New Capabilities for Subagents
Subagents (inline recipes) now support the full Recipe specification:
- Recipe context (initial conversation messages)
- Recipe activities (execution logging)
- Recipe retry configuration
- Recipe response schemas with FinalOutputTool validation
- Recipe settings for provider/model overrides
Implementation Details
Both subrecipes and subagents now flow through the same execution path. At task creation, subrecipes are loaded and transformed into Recipe objects, making them indistinguishable from inline recipes during execution. The ModelOverrideProvider enables recipe-specific settings without creating new provider instances.
This moves toward the unified execution model outlined in #4389, where all agent work flows through consistent pipelines regardless of entry point.
@yingjiehe-xyz can you do a first pass as you touched this last
@lifeizhou-ap can you check out the subrecipe changes here?
Hi @tlongwell-block,
Thanks for removing cli code for running subrecipe! I've added a couple of comments regarding the sub-recipe behaviour. Also please test with the subrecipe features in CLI and Desktop to check the behaviours and the output. Thank you!