-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Unify subrecipe and subagent execution through shared recipe pipeline #5082
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Replace subprocess spawning with in-process execution - Convert SubRecipes to InlineRecipes at load time - Remove 171 lines of subprocess management code - Add simple 14-line load_sub_recipe helper - Net reduction: 140 lines removed from codebase All existing tests pass. SubRecipes now execute 5-10x faster without subprocess overhead.
|
@yingjiehe-xyz can you do a first pass as you touched this last |
yingjiehe-xyz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
subagent parts looks good, not fully familiar with sub-recipe
|
@lifeizhou-ap can you check out the subrecipe changes here? |
- Resolved conflicts in subagent_handler.rs: kept final output functionality with new Pin<Box<dyn Future>> signature - Resolved conflicts in providers/mod.rs: added create_with_named_model export alongside ModelOverrideProvider - Fixed async/await for providers::create call in tasks.rs to match new async factory
- Added Arc<Mutex<()>> to SessionStorage to serialize session creation - Prevents concurrent sessions from getting duplicate IDs - Much simpler than retry logic (5-10 lines vs 35-40 lines) - Test passes: test_concurrent_session_creation
crates/goose/src/agents/subagent_execution_tool/task_execution_tracker.rs
Show resolved
Hide resolved
|
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! |
- Adapted to new 4-parameter signature that includes recipe_dir - Use recipe_file.content and recipe_file.parent_dir from RecipeFile struct - Tests pass and functionality verified
crates/goose/src/agents/subagent_execution_tool/task_execution_tracker.rs
Show resolved
Hide resolved
crates/goose/src/agents/subagent_execution_tool/task_execution_tracker.rs
Outdated
Show resolved
Hide resolved
crates/goose/src/agents/subagent_execution_tool/task_execution_tracker.rs
Outdated
Show resolved
Hide resolved
…nt, cloneable RecipeFile
- Resolved conflict in CreateScheduleModal.tsx - Kept context removal changes - Incorporated initialDeepLink feature from main - Removed goosehints and profile fields that aren't in API
…tiation using get_name() - Removed ModelOverrideProvider wrapper class (210+ lines) - Use provider.get_name() to recreate providers with overrides - Clean pattern matching for all override scenarios - Simplified codebase and improved maintainability - All tests passing
- Removed obvious comments that just restate what the code does - Kept only comments that provide additional context (e.g., tool response extraction) - Cleaner, more professional code without redundant documentation
DOsinga
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good improvement. can you have a look at including the recipe as a schema element? that would really land this
| .clone(); | ||
|
|
||
| Tool::new( | ||
| DYNAMIC_TASK_TOOL_NAME_PREFIX.to_string(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
above, can you remove the .expects()? it would crash the server if that broke
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ends up opening a bit of a can of worms. This should get looked at when we move the tools to a platform extension
crates/goose/src/agents/subagent_execution_tool/task_execution_tracker.rs
Outdated
Show resolved
Hide resolved
* main: (21 commits) differentiate debug/release in cache key (#5613) Unify subrecipe and subagent execution through shared recipe pipeline (#5082) Standardize CLI argument flags and update documentation (#5516) Release 1.13.0 fix: move goosehints/AGENTS.md handling to goose, and out of developer extension (#5575) fix: add standard context menu items to prevent empty right-click menu (#5616) Bump openapi in prepare-release (#5611) docs: add access control section to Developer tutorial (#5615) Token state not showing on load, or after message is finished. (#5606) Change the other location too (#5608) feat(ui): bring back quick launcher (#5144) Support platform tools through CLI (#5570) Avoid web double write (#5601) fix: gemini flash -> pro for mcp smoke tests (#5574) Manual compaction test and fix (#5568) fix: tidy up claude cli handling (#5594) Remove jetbrains (#5602) feat(githubcopilot): add support for newer Copilot AI Models (#5603) fix: customised recipe to yaml string to avoid minininjia parsing error (#5494) Add pending extension indicator to extension panel (#5493) ...
…block#5082) Signed-off-by: fbalicchia <[email protected]>
…eanup * 'main' of github.com:block/goose: Use session IDs as task IDs for subagents instead of UUIDs (#5398) Fix the naming (#5628) fix: default tetrate model is broken, replace with haiku-4.5 (#5535) (#5587) Fetch less and use the right SHA (#5621) feat(ui): add custom macOS dock menu with New Window option (#5099) feat: remove hints from recipe prompts (#5622) docs: October 2025 Community All-Stars spotlight, Hacktoberfest edition (#5625) differentiate debug/release in cache key (#5613) Unify subrecipe and subagent execution through shared recipe pipeline (#5082)
* origin/main: (34 commits) Remove some logging (#5631) Use session IDs as task IDs for subagents instead of UUIDs (#5398) Fix the naming (#5628) fix: default tetrate model is broken, replace with haiku-4.5 (#5535) (#5587) Fetch less and use the right SHA (#5621) feat(ui): add custom macOS dock menu with New Window option (#5099) feat: remove hints from recipe prompts (#5622) docs: October 2025 Community All-Stars spotlight, Hacktoberfest edition (#5625) differentiate debug/release in cache key (#5613) Unify subrecipe and subagent execution through shared recipe pipeline (#5082) Standardize CLI argument flags and update documentation (#5516) Release 1.13.0 fix: move goosehints/AGENTS.md handling to goose, and out of developer extension (#5575) fix: add standard context menu items to prevent empty right-click menu (#5616) Bump openapi in prepare-release (#5611) docs: add access control section to Developer tutorial (#5615) Token state not showing on load, or after message is finished. (#5606) Change the other location too (#5608) feat(ui): bring back quick launcher (#5144) Support platform tools through CLI (#5570) ...
* main: (33 commits) Fix Claude Code provider to default to Auto mode (#5638) (#5642) Scheduler cleanup (#5571) Better search paths and handling of CLI providers (#5554) docs: description required for "Add Extension" in cli - phase 2 (#5635) Remove some logging (#5631) Use session IDs as task IDs for subagents instead of UUIDs (#5398) Fix the naming (#5628) fix: default tetrate model is broken, replace with haiku-4.5 (#5535) (#5587) Fetch less and use the right SHA (#5621) feat(ui): add custom macOS dock menu with New Window option (#5099) feat: remove hints from recipe prompts (#5622) docs: October 2025 Community All-Stars spotlight, Hacktoberfest edition (#5625) differentiate debug/release in cache key (#5613) Unify subrecipe and subagent execution through shared recipe pipeline (#5082) Standardize CLI argument flags and update documentation (#5516) Release 1.13.0 fix: move goosehints/AGENTS.md handling to goose, and out of developer extension (#5575) fix: add standard context menu items to prevent empty right-click menu (#5616) Bump openapi in prepare-release (#5611) docs: add access control section to Developer tutorial (#5615) ...
…block#5082) Signed-off-by: Blair Allan <[email protected]>
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
goose run --reciperun_complete_subagent_task()pathBackend Changes for Subrecipes
Subrecipes previously spawned a subprocess (
goose run --recipe) which naturally supported all Recipe features. Now they:New Capabilities for Subagents
Subagents (inline recipes) now support the full Recipe specification:
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.