Skip to content

Add General Purpose agent support#295494

Draft
digitarald wants to merge 6 commits intomainfrom
digitarald/general-purpose-subagent
Draft

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

Conversation

@digitarald
Copy link
Copy Markdown
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 a 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
  • Removed dead IConfigurationService injection
  • Consolidated duplicate ILanguageModelToolsService injection into single languageModelToolsService

computeAutomaticInstructions.ts

  • <agents> XML block now renders whenever runSubagentTool is available (config gate removed)
  • Hardcoded "General Purpose" entry always appears first
  • Imports GeneralPurposeAgentName from constants.ts (avoids cyclic dependency with runSubagentTool.ts)

constants.ts

  • Added GeneralPurposeAgentName = 'General Purpose' constant (shared by runSubagentTool.ts and computeAutomaticInstructions.ts)

Setting removal (SubagentToolCustomAgents)

  • Deleted enum value from constants.ts
  • Removed configuration registration from chat.contribution.ts
  • Removed settings layout entry from settingsLayout.ts

Tests

  • runSubagentTool.test.ts: Updated createTool helpers (removed dead DI args), added tests for undefined/empty/explicit General Purpose agentName handling
  • computeAutomaticInstructions.test.ts: Removed config setup calls, deleted "disabled custom agents" test, agents list test expects General Purpose first

Testing

  • 15/15 RunSubagentTool tests passing
  • 38/38 ComputeAutomaticInstructions tests passing
  • No cyclic dependencies (verified with checkCyclicDependencies.ts)

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
Copy Markdown
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

dmitrivMS
dmitrivMS previously approved these changes Feb 16, 2026
@vs-code-engineering
Copy link
Copy Markdown
Contributor

vs-code-engineering bot commented Feb 24, 2026

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@rzhao271

Matched files:

  • src/vs/workbench/contrib/preferences/browser/settingsLayout.ts

DonJayamanne
DonJayamanne previously approved these changes Feb 24, 2026
@mjbvz
Copy link
Copy Markdown
Collaborator

mjbvz commented Mar 5, 2026

Moving this to 1.112 so that we can get the 1.111 milestone into good shape by the end of Thursday

Please take this in as a candidate if it must go into 1.111

@mjbvz mjbvz modified the milestones: 1.111.0, 1.112.0 Mar 5, 2026
@digitarald digitarald removed this from the 1.112.0 milestone Mar 17, 2026
@digitarald digitarald added this to the 1.113.0 milestone Mar 17, 2026
@jrieken jrieken modified the milestones: 1.113.0, On Deck Mar 25, 2026
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.

8 participants