Skip to content

Plan Agent: Search subagent if explore disabled#312027

Draft
24anisha wants to merge 5 commits intomainfrom
anisha/plan_search
Draft

Plan Agent: Search subagent if explore disabled#312027
24anisha wants to merge 5 commits intomainfrom
anisha/plan_search

Conversation

@24anisha
Copy link
Copy Markdown
Contributor

Update Plan Agent so it defaults to using search subagent if the explore subagent is disabled

Copilot AI review requested due to automatic review settings April 22, 2026 22:37
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

Updates the Copilot Plan agent prompt so that when the Explore subagent is disabled, the agent falls back to using the search subagent for discovery.

Changes:

  • Make Plan agent “Discovery” instructions conditional on whether Explore agent and/or Search subagent are enabled.
  • Introduce a tool-name alias mapping (explore_subagentsearch_subagent) in tool-name resolution.
  • Refactor SearchSubagentTool.alternativeDefinition() to build an updated tool definition object before returning.
Show a summary per file
File Description
extensions/copilot/src/extension/tools/node/searchSubagentTool.ts Refactors how the tool definition is modified when thoroughness support is enabled.
extensions/copilot/src/extension/tools/common/toolNames.ts Adds alias mapping intended to resolve alternative tool names back to canonical ToolNames.
extensions/copilot/src/extension/prompt/node/pseudoStartStopConversationCallback.ts Updates imports to include getToolName (currently unused).
extensions/copilot/src/extension/agents/vscode-node/planAgentProvider.ts Makes the Plan agent prompt vary based on Explore/Search enablement flags.

Copilot's findings

Comments suppressed due to low confidence (1)

extensions/copilot/src/extension/agents/vscode-node/planAgentProvider.ts:122

  • The discovery text mixes search_subagent and explore_subagent tool names. As-is, the tool contributed in package.json is search_subagent, and explore_subagent is not a registered tool, so this prompt can lead the model to attempt calling a nonexistent tool. Make the instructions consistently reference the actual available tool name (or ensure the alias is truly registered/handled end-to-end).
			discoverySection = `## 1. Discovery

Use the *search_subagent* tool to gather context, analogous existing features to use as implementation templates, and potential blockers or ambiguities. When the task spans multiple independent areas (e.g., frontend + backend, different features, separate repos), launch **2-3 *explore_subagent* tools in parallel** — one per area — to speed up discovery.

Update the plan with your findings.`;
  • Files reviewed: 2/2 changed files
  • Comments generated: 1

e.affectsConfiguration('chat.planAgent.defaultModel') ||
e.affectsConfiguration(ConfigKey.ImplementAgentModel.fullyQualifiedId)) {
e.affectsConfiguration(ConfigKey.ImplementAgentModel.fullyQualifiedId) ||
e.affectsConfiguration(ConfigKey.ExploreAgentEnabled.fullyQualifiedId)) {
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

In the config-change listener, the Plan agent body now depends on ConfigKey.Advanced.SearchSubagentToolEnabled, but changes to that setting won't trigger _onDidChangeCustomAgents.fire() (only ExploreAgentEnabled was added). This can leave the cached agent definition stale until some other setting changes; include the search-subagent enablement key in this affectsConfiguration(...) set as well.

This issue also appears on line 118 of the same file.

Suggested change
e.affectsConfiguration(ConfigKey.ExploreAgentEnabled.fullyQualifiedId)) {
e.affectsConfiguration(ConfigKey.ExploreAgentEnabled.fullyQualifiedId) ||
e.affectsConfiguration(ConfigKey.Advanced.SearchSubagentToolEnabled.fullyQualifiedId)) {

Copilot uses AI. Check for mistakes.
@24anisha 24anisha marked this pull request as draft April 22, 2026 22:45
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