Skip to content

Conversation

@rabi
Copy link
Contributor

@rabi rabi commented Jan 16, 2026

Summary

  • Retain subagent tool even when code_execution mode is active
  • Allows subagent to be called directly without going through code_execution

Type of Change

  • Feature
  • Bug fix
  • Refactor / Code quality
  • Performance improvement
  • Documentation
  • Tests
  • Security fix
  • Build / Release
  • Other (specify below)

Testing

Tested locally.

( O)> check ~/.config/goose/config.yaml and list the extensions enabled.

─── 1 tool call | execute_code ──────────────────────────
  1. developer/shell: Read the goose config file using cat to handle home directory expansion


─── 1 tool call | execute_code ──────────────────────────
  1. developer/shell: Read the first 50 lines of the config file to check for missed extensions

Based on the configuration file at `~/.config/goose/config.yaml`, the following extensions are currently enabled:

*   **developer**: Code editing and shell access
*   **skills**: Load and use skills from .claude/skills or .goose/skills directories
*   **extensionmanager**: Enable extension management tools
*   **chatrecall**: Search past conversations and load session summaries
*   **autovisualiser**: Data visualization and UI generation tools
*   **memory**: Teach goose your preferences as you go
*   **code_execution**: Execute JavaScript code in a sandboxed environment
*   **github**: github extension

The following extensions are present but **disabled**:
*   todo
*   computercontroller
*   tutorial
*   jira
*   kiteextension
*   kiwitravel

( O)> Use a subagent with google provider and gemini-3-pro-preview model to fetch last 10 PRs from vllm-project/vllm and another subagent with gcp_vertex_ai provider and claude-opus-4-5@20251101 model to fetch last 10 PRs from sgl-project/sglang and then present them together

─── subagent |  ──────────────────────────
instructions: Fetch the last 10 Pull Requests from the repository 'vllm-project/vllm' using the GitHub tool. Li...
settings:
    model: gemini-3-pro-preview
    provider: google


─── subagent |  ──────────────────────────
instructions: Fetch the last 10 Pull Requests from the repository 'sgl-project/sglang' using the GitHub tool. L...
settings:
    model: claude-opus-4-5@20251101
    provider: gcp_vertex_ai

Here are the last 10 Pull Requests for **vllm-project/vllm** and **sgl-project/sglang**.
.....

- Retain subagent tool even when code_execution mode is active
- Allows subagent to be called directly without going through code_execution

Signed-off-by: rabi <ramishra@redhat.com>
@alexhancock
Copy link
Collaborator

I'm not sure.

Why wouldn't we want subagent execution to go through code execution? I get that it might be harder to get granular info back about what the subagents are doing, but not impossible... and to have the top level agent be able to orchestrate subagents from code feels potentially powerful.

Thoughts?

@rabi
Copy link
Contributor Author

rabi commented Jan 17, 2026

I'm not sure.

Why wouldn't we want subagent execution to go through code execution? I get that it might be harder to get granular info back about what the subagents are doing, but not impossible... and to have the top level agent be able to orchestrate subagents from code feels potentially powerful.

Thoughts?

Thanks for checking the PR Alex. Here are my thoughts...

  • Code‑execution mode only exposes extension tools right now; subagent is injected by Agent::list_tools, so it isn’t visible to code_execution. At present it tries hard before falling back to things like below..
import { shell } from "developer";

const vllmCmd = `goose run --no-session --provider google --model gemini-2.5-pro --text "Fetch last 10 PRs for vllm-project/vllm. Save them as a valid JSON array to 'vllm_prs.json'. Fields: title, url, author, created_at. Then run 'cat vllm_prs.json'." --quiet`;

const vllmRaw = shell({ command: vllmCmd });
record_result({ vllmRaw });
  • We could expose it, but subagents are full sessions. execute_code bypasses normal tool‑request flow, so surfacing subagent activity would need lot of extra plumbing.
  • One batched execute_code call could spawn multiple subagents — a fan‑out multiplier that increases complexity and is harder for users to follow.
  • A subagent started with code_execution enabled will still use it for its own tool calls, so we’re probably not gaining extra sandboxing or batching by triggering it from JS.

@alexhancock
Copy link
Collaborator

I'm not sure.
Why wouldn't we want subagent execution to go through code execution? I get that it might be harder to get granular info back about what the subagents are doing, but not impossible... and to have the top level agent be able to orchestrate subagents from code feels potentially powerful.
Thoughts?

Thanks for checking the PR Alex. Here are my thoughts...

  • Code‑execution mode only exposes extension tools right now; subagent is injected by Agent::list_tools, so it isn’t visible to code_execution. At present it tries hard before falling back to things like below..
import { shell } from "developer";

const vllmCmd = `goose run --no-session --provider google --model gemini-2.5-pro --text "Fetch last 10 PRs for vllm-project/vllm. Save them as a valid JSON array to 'vllm_prs.json'. Fields: title, url, author, created_at. Then run 'cat vllm_prs.json'." --quiet`;

const vllmRaw = shell({ command: vllmCmd });
record_result({ vllmRaw });
  • We could expose it, but subagents are full sessions. execute_code bypasses normal tool‑request flow, so surfacing subagent activity would need lot of extra plumbing.
  • One batched execute_code call could spawn multiple subagents — a fan‑out multiplier that increases complexity and is harder for users to follow.
  • A subagent started with code_execution enabled will still use it for its own tool calls, so we’re probably not gaining extra sandboxing or batching by triggering it from JS.

It makes sense. Thanks @rabi

@alexhancock alexhancock merged commit a05f5a3 into block:main Jan 20, 2026
17 checks passed
katzdave added a commit that referenced this pull request Jan 21, 2026
…ovider

* 'main' of github.com:block/goose:
  increase worker threads for ci (#6614)
  docs: todo tutorial update (#6613)
  Added goose doc map md file for goose agent to find relevant doc easily. (#6598)
  add back goose branding to home (#6617)
  fix: actually set the working dir for extensions from session (#6612)
  Multi chat (#6428)
  Lifei/fixed accumulated token count (#6587)
  Dont show MCP UI/Apps until tool is approved (#6492)
  docs: max tokens config (#6596)
  User configurable templates (#6420)
  docs: http proxy environment variables (#6594)
  feat: exclude subagent tool from code_execution filtering (#6531)
michaelneale added a commit that referenced this pull request Jan 21, 2026
* main:
  increase worker threads for ci (#6614)
  docs: todo tutorial update (#6613)
  Added goose doc map md file for goose agent to find relevant doc easily. (#6598)
  add back goose branding to home (#6617)
  fix: actually set the working dir for extensions from session (#6612)
  Multi chat (#6428)
  Lifei/fixed accumulated token count (#6587)
  Dont show MCP UI/Apps until tool is approved (#6492)
  docs: max tokens config (#6596)
  User configurable templates (#6420)
  docs: http proxy environment variables (#6594)
  feat: exclude subagent tool from code_execution filtering (#6531)
  Fix path for global agent skills (#6591)
  recipes: add mcp server (#6552)
  feat(gcp-vertex): add model list with org policy filtering (#6393)
  chore: encourage extension searching (#6582)
  blog: mobile apps consolidation and roadmap (#6580)
  chore: remove unused dependencies in cargo.toml (#6561)
  resolved all the extensions to load in cli (#6464)
lifeizhou-ap added a commit that referenced this pull request Jan 22, 2026
* main: (41 commits)
  chore: tweak release docs (#6571)
  fix(goose): propagate session_id across providers and MCP (#6584)
  increase worker threads for ci (#6614)
  docs: todo tutorial update (#6613)
  Added goose doc map md file for goose agent to find relevant doc easily. (#6598)
  add back goose branding to home (#6617)
  fix: actually set the working dir for extensions from session (#6612)
  Multi chat (#6428)
  Lifei/fixed accumulated token count (#6587)
  Dont show MCP UI/Apps until tool is approved (#6492)
  docs: max tokens config (#6596)
  User configurable templates (#6420)
  docs: http proxy environment variables (#6594)
  feat: exclude subagent tool from code_execution filtering (#6531)
  Fix path for global agent skills (#6591)
  recipes: add mcp server (#6552)
  feat(gcp-vertex): add model list with org policy filtering (#6393)
  chore: encourage extension searching (#6582)
  blog: mobile apps consolidation and roadmap (#6580)
  chore: remove unused dependencies in cargo.toml (#6561)
  ...
wpfleger96 added a commit that referenced this pull request Jan 22, 2026
* main: (68 commits)
  fix(docs): use dynamic import for globby ESM module (#6636)
  chore: trigger CI
  Document tab completion (#6635)
  Install goose-mcp crate dependencies (#6632)
  feat(goose): standardize agent-session-id for session correlation (#6626)
  chore: tweak release docs (#6571)
  fix(goose): propagate session_id across providers and MCP (#6584)
  increase worker threads for ci (#6614)
  docs: todo tutorial update (#6613)
  Added goose doc map md file for goose agent to find relevant doc easily. (#6598)
  add back goose branding to home (#6617)
  fix: actually set the working dir for extensions from session (#6612)
  Multi chat (#6428)
  Lifei/fixed accumulated token count (#6587)
  Dont show MCP UI/Apps until tool is approved (#6492)
  docs: max tokens config (#6596)
  User configurable templates (#6420)
  docs: http proxy environment variables (#6594)
  feat: exclude subagent tool from code_execution filtering (#6531)
  Fix path for global agent skills (#6591)
  ...
wpfleger96 added a commit that referenced this pull request Jan 22, 2026
* main: (68 commits)
  fix(docs): use dynamic import for globby ESM module (#6636)
  chore: trigger CI
  Document tab completion (#6635)
  Install goose-mcp crate dependencies (#6632)
  feat(goose): standardize agent-session-id for session correlation (#6626)
  chore: tweak release docs (#6571)
  fix(goose): propagate session_id across providers and MCP (#6584)
  increase worker threads for ci (#6614)
  docs: todo tutorial update (#6613)
  Added goose doc map md file for goose agent to find relevant doc easily. (#6598)
  add back goose branding to home (#6617)
  fix: actually set the working dir for extensions from session (#6612)
  Multi chat (#6428)
  Lifei/fixed accumulated token count (#6587)
  Dont show MCP UI/Apps until tool is approved (#6492)
  docs: max tokens config (#6596)
  User configurable templates (#6420)
  docs: http proxy environment variables (#6594)
  feat: exclude subagent tool from code_execution filtering (#6531)
  Fix path for global agent skills (#6591)
  ...
wpfleger96 added a commit that referenced this pull request Jan 22, 2026
* main: (68 commits)
  fix(docs): use dynamic import for globby ESM module (#6636)
  chore: trigger CI
  Document tab completion (#6635)
  Install goose-mcp crate dependencies (#6632)
  feat(goose): standardize agent-session-id for session correlation (#6626)
  chore: tweak release docs (#6571)
  fix(goose): propagate session_id across providers and MCP (#6584)
  increase worker threads for ci (#6614)
  docs: todo tutorial update (#6613)
  Added goose doc map md file for goose agent to find relevant doc easily. (#6598)
  add back goose branding to home (#6617)
  fix: actually set the working dir for extensions from session (#6612)
  Multi chat (#6428)
  Lifei/fixed accumulated token count (#6587)
  Dont show MCP UI/Apps until tool is approved (#6492)
  docs: max tokens config (#6596)
  User configurable templates (#6420)
  docs: http proxy environment variables (#6594)
  feat: exclude subagent tool from code_execution filtering (#6531)
  Fix path for global agent skills (#6591)
  ...
fbalicchia pushed a commit to fbalicchia/goose that referenced this pull request Jan 23, 2026
Signed-off-by: rabi <ramishra@redhat.com>
Signed-off-by: fbalicchia <fbalicchia@cuebiq.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.

2 participants