Skip to content

Conversation

@wendytang
Copy link

@wendytang wendytang commented Jul 15, 2025

New: Dynamic Task Creation Tool:
image

SubAgent parallel execution with Task framework (instead of > goose run ...):
image

Summary of Changes:

  1. Adds dynamic_task__create_task tool which creates Task with text_instruction
  2. Uses SubAgent to execute Tasks with text_instruction
  3. Passes necessary information to execute a task in TaskConfig, which is then passed to SubAgent for execution
  4. Other refactors: sub_recipe_execution_tool -> sub_agent_execution, removes subagent_manager, etc.

Going forward, TaskConfig can be the handoff between recipe and subagent.

Implements the dynamic task tool and subagent execution in diagram:
image

lifeizhou-ap and others added 30 commits July 7, 2025 13:10
* main: (23 commits)
  docs: VS Code MCP video (#3307)
  docs: fixed broken link (#3306)
  Add YouTube video to Netlify MCP documentation (#3302)
  docs: add sub-recipes topic (#3241)
  docs: move topics to tutorials section (#3297)
  site analytics (#3293)
  chore(release): release version 1.0.35 (#3292)
  docs: enhanced code editing topic (#3287)
  fix cu (#3291)
  feat: Add environment variables to override model context limits (#3260)
  chore(release): release version 1.0.34 (#3285)
  fix(devcontainer): install protoc to fix build (#3267)
  Enabling npx command to install on Windows Desktop (#3283)
  Fix: Allow native Cmd+Up/Down cursor movement when user has typed text (#3246)
  chore(release): release version 1.0.33 (#3284)
  fix Windows Env Vars (#3282)
  feat: bedrock image content support (#3266)
  Add support in goose configure for streaming http mcp tools (#3256)
  docs: add Alby MCP tutorial (#3217)
  refactor(tests): make logging test in goose-cli less flaky on macos (#3273)
  ...
@wendytang wendytang requested a review from lifeizhou-ap July 15, 2025 22:48
@wendytang wendytang marked this pull request as ready for review July 15, 2025 22:48
@wendytang wendytang changed the title feat: consolidate subagent execution feat: consolidate subagent execution for text_instruction tasks Jul 15, 2025
@wendytang wendytang changed the title feat: consolidate subagent execution for text_instruction tasks feat: consolidate subagent execution for dynamic,text_instruction tasks Jul 15, 2025
@wendytang wendytang changed the title feat: consolidate subagent execution for dynamic,text_instruction tasks feat: consolidate subagent execution for dynamic tasks Jul 15, 2025
@wendytang wendytang changed the base branch from lifei/run-sub-recipe-multiple-times to main July 16, 2025 17:55
@wendytang wendytang marked this pull request as draft July 16, 2025 23:29
Wendy Tang and others added 6 commits July 16, 2025 16:31
* main:
  feat(gcpvertexai): do HTTP 429 like retries for Anthropic API HTTP 529 overloaded status code (#3026)
  Fix a few ui edge cases - refresh occasionally crashing, chat loader over text and chat input height returning to auto (#3469)
  Don't default to main for build-cli (#3467)
  docs: add MongoDB MCP server tutorial (#2660)
  feat: run sub recipe multiple times in parallel (Experimental feature) (#3274)
  chore(release): release version 1.1.0 (#3465)
  chore: implement streaming for anthropic.rs firstparty provider (#3419)
  Fix regression: add back detail to tool-call banners (#3231)
  Document release process and update some just recipes (#3460)
  feat: add download_cli.ps1 file for windows (#3354)
  fix: session_file is optional (#3462)
  Bump more space for goose is working on it so it doesnt overlap incoming agent chat messages (#3453)
  Align chat input action buttons to bottom when large amount of text (#3455)
  docs: add Cloudflare MCP Server tutorial (#3278)
  feat(cli): Clear persisted session file with /clear command (#3145)
Copy link
Collaborator

@lifeizhou-ap lifeizhou-ap left a comment

Choose a reason for hiding this comment

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

Hi @wendytang,

I have pulled the latest version of main branch with my PR change into this branch, and resolved the conflicts. Please check whether there are anything missed after the merge.

The PR looks good to me overall! Great work!

I’ve added a few comments with suggestions.

I’ll approve it now, but it'd be great if you could take a look at the comments and update things before merging. Let me know if you want to chat about anything!

pub(super) router_tool_selector: Mutex<Option<Arc<Box<dyn RouterToolSelector>>>>,
pub(super) scheduler_service: Mutex<Option<Arc<dyn SchedulerTrait>>>,
pub(super) subagent_manager: Mutex<Option<SubAgentManager>>,
pub(super) mcp_tx: Mutex<mpsc::Sender<JsonRpcMessage>>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

If I understand correctly, this will be eventually passed to the subagent via the subagent_execute_task_tool

I feel we can reuse the channel here https://github.com/block/goose/blob/wtang/execute_dynamic_tasks/crates/goose/src/agents/subagent_execution_tool/subagent_execute_task_tool.rs#L67 instead

Copy link
Author

@wendytang wendytang Jul 17, 2025

Choose a reason for hiding this comment

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

we can address the channel updates as a follow up!

let mcp_tx = self.mcp_tx.lock().await.clone();

let task_config =
TaskConfig::new(provider, Some(Arc::clone(&self.extension_manager)), mcp_tx);
Copy link
Collaborator

Choose a reason for hiding this comment

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

  • we can add provider as default_provider and extension_manager in the tasks_manager so that we don't need to pass the task_config when run_tasks.

  • mcp_tx probably does not need to pass as we can reuse the one inside subagent_execute_task_tool

  • Are we going to pass the extensions instead of extension_manager later?

Copy link
Author

Choose a reason for hiding this comment

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

Are we going to pass the extensions instead of extension_manager later?

No turns out we need the extension manager in order to dispatch mcp tool calls

Copy link
Author

Choose a reason for hiding this comment

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

mcp_tx probably does not need to pass as we can reuse the one inside subagent_execute_task_tool

I agree, we can address this afterwards.

Copy link
Collaborator

@lifeizhou-ap lifeizhou-ap Jul 17, 2025

Choose a reason for hiding this comment

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

Are we going to pass the extensions instead of extension_manager later?

No turns out we need the extension manager in order to dispatch mcp tool calls

Just curious how sub-recipe pass the extensions to the subAgent.rs then? I remember we were planning to have extensions as an attribute of subAgent (eg SubAgent constructor params)

@wendytang wendytang marked this pull request as ready for review July 17, 2025 17:58
@wendytang
Copy link
Author

merging with follow ups here

@wendytang wendytang merged commit 4771ffb into main Jul 18, 2025
7 checks passed
@wendytang wendytang deleted the wtang/execute_dynamic_tasks branch July 18, 2025 01:48
s-soroosh pushed a commit to s-soroosh/goose that referenced this pull request Jul 18, 2025
Co-authored-by: Lifei Zhou <lifei@squareup.com>
Signed-off-by: Soroosh <soroosh.sarabadani@gmail.com>
jsibbison-square added a commit that referenced this pull request Jul 20, 2025
…ntral-deeplinks

* origin/main: (22 commits)
  feat: deprecate jetbrains extension in favor of public one (#2589)
  feat: Add LiteLLM provider with automatic prompt caching support (#3380)
  docs: update desktop instructions for managing sessions (#3522)
  docs: update desktop instructions for session recipes (#3521)
  Replace mcp_core::content types with rmcp::model types (#3500)
  docs: update desktop instructions for tool perms (#3518)
  docs: update desktop instructions for tool router (#3519)
  Alexhancock/reapply 3491 (#3515)
  docs: update mcp install instructions for desktop (#3504)
  Docs: Access settings in new UI (#3514)
  feat: switch from mcp_core::Role to rmcp::model::Role (#3488)
  Revert "fix the output not being visible issue (#3491)" (#3511)
  fix: Load and Use recipes in new window (#3501)
  fix: working dir was not being set correctly  (#3477)
  Fix launching session in new window (#3497)
  Fix tool call allow still showing initial state in chat after navigating back (#3498)
  feat: add rmcp as a workspace dep (#3483)
  feat: consolidate subagent execution for dynamic tasks (#3444)
  fix token alert indicator/popovers hiding and showing (#3492)
  Fix llm errors not propagating to the ui and auto summarize not starting (#3490)
  ...
cbruyndoncx pushed a commit to cbruyndoncx/goose that referenced this pull request Jul 20, 2025
Co-authored-by: Lifei Zhou <lifei@squareup.com>
atarantino pushed a commit to atarantino/goose that referenced this pull request Aug 5, 2025
Co-authored-by: Lifei Zhou <lifei@squareup.com>
Signed-off-by: Adam Tarantino <tarantino.adam@hey.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants