Skip to content

Add General Purpose agent support#295494

Open
digitarald wants to merge 2 commits intomainfrom
digitarald/general-purpose-subagent
Open

Add General Purpose agent support#295494
digitarald wants to merge 2 commits intomainfrom
digitarald/general-purpose-subagent

Conversation

@digitarald
Copy link
Contributor

@digitarald digitarald commented Feb 15, 2026

Exposes a built-in "General Purpose" subagent so the model always has a named agent for parallel execution, without requiring the SubagentToolCustomAgents config flag.

Refs microsoft/vscode-internalbacklog#6750

Changes

runSubagentTool.ts

  • agentName is now required in the tool schema (always present, not gated by config)
  • "General Purpose" constant (GeneralPurposeAgentName) — when selected, inherits the parent's system prompt, model, and tools (same as the previous unnamed-agent behavior)
  • invoke() / prepareToolInvocation() use isGeneralPurpose check to branch between built-in and custom agent paths
  • BaseModelDescription always includes the agent-name instruction
  • Error message references "General Purpose" as a fallback

computeAutomaticInstructions.ts

  • <agents> XML block now renders whenever runSubagentTool is available (outer config gate removed)
  • Hardcoded "General Purpose" entry always appears first
  • Custom agents from providers still gated by SubagentToolCustomAgents config

runSubagentTool.test.ts

  • Tests updated: agentName always in schema, required array includes it
  • Removed config-gated test (no longer applicable)
  • "General Purpose" agent test confirms inherited model/tools behavior

Testing

  • 12/12 unit tests passing
  • No compilation errors

Copilot AI review requested due to automatic review settings February 15, 2026 22:42
@digitarald digitarald self-assigned this Feb 15, 2026
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 15, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds support for a built-in "General Purpose" agent to the runSubagent tool. The General Purpose agent allows the tool to invoke a subagent that inherits the parent agent's model, tools, and system prompt, providing a full-capability option when custom agents don't fit the task.

Changes:

  • Made agentName a required parameter in the runSubagent tool schema, with defensive handling for models that omit it
  • Introduced the GeneralPurposeAgentName constant as the canonical name for the built-in general-purpose agent
  • Modified automatic instructions to always include the General Purpose agent first in the agents list, followed by custom agents (when enabled)
  • Updated tests to verify General Purpose agent behavior including undefined/empty string handling

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.ts Added GeneralPurposeAgentName constant; made agentName required in schema; updated invoke and prepareToolInvocation to handle General Purpose agent as default; simplified onDidUpdateToolData to Event.None
src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.ts Modified to always include General Purpose agent first in agents list, with custom agents conditionally added when config enabled
src/vs/workbench/contrib/chat/test/common/tools/builtinTools/runSubagentTool.test.ts Added createTool helper; added tests for undefined/empty agentName handling as General Purpose; updated existing tests to expect agentName in schema and General Purpose agent name in results
src/vs/workbench/contrib/chat/test/common/promptSyntax/computeAutomaticInstructions.test.ts Updated test expectations to account for General Purpose agent being first; added test for disabled custom agents showing only General Purpose agent

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