Delete runSubagent tool (#1819)

* Delete runSubagent tool
Moving to the core version

* Fix
This commit is contained in:
Rob Lourens
2025-11-06 06:43:28 +00:00
committed by GitHub
parent ae63ea63a6
commit 8a986974ba
7 changed files with 5 additions and 111 deletions

View File

@@ -2,7 +2,7 @@
name: Plan
description: Researches and outlines multi-step plans
argument-hint: Outline the goal or problem to research
tools: ['search', 'github/github-mcp-server/get_issue', 'github/github-mcp-server/get_issue_comments', 'runSubagent', 'runSubagent2', 'usages', 'problems', 'changes', 'testFailure', 'fetch', 'githubRepo', 'github.vscode-pull-request-github/issue_fetch', 'github.vscode-pull-request-github/activePullRequest']
tools: ['search', 'github/github-mcp-server/get_issue', 'github/github-mcp-server/get_issue_comments', 'runSubagent', 'usages', 'problems', 'changes', 'testFailure', 'fetch', 'githubRepo', 'github.vscode-pull-request-github/issue_fetch', 'github.vscode-pull-request-github/activePullRequest']
handoffs:
- label: Start Implementation
agent: agent

View File

@@ -163,33 +163,6 @@
]
}
},
{
"name": "runSubagent",
"toolReferenceName": "runSubagent",
"displayName": "%copilot.tools.runSubagent.name%",
"canBeReferencedInPrompt": true,
"userDescription": "%copilot.tools.runSubagent.description%",
"modelDescription": "Launch a new agent to handle complex, multi-step tasks autonomously. This tool is good at researching complex questions, searching for code, and executing multi-step tasks. When you are searching for a keyword or file and are not confident that you will find the right match in the first few tries, use this agent to perform the search for you.\n\n- Agents do not run async or in the background, you will wait for the agent's result.\n- When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.\n - Each agent invocation is stateless. You will not be able to send additional messages to the agent, nor will the agent be able to communicate with you outside of its final report. Therefore, your prompt should contain a highly detailed task description for the agent to perform autonomously and you should specify exactly what information the agent should return back to you in its final and only message to you.\n - The agent's outputs should generally be trusted\n - Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, web fetches, etc.), since it is not aware of the user's intent",
"tags": [],
"when": "!config.chat.experimental.runSubagent2",
"inputSchema": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"description": "A detailed description of the task for the agent to perform"
},
"description": {
"type": "string",
"description": "A short (3-5 word) description of the task"
}
},
"required": [
"prompt",
"description"
]
}
},
{
"name": "copilot_searchWorkspaceSymbols",
"toolReferenceName": "symbols",

View File

@@ -359,7 +359,5 @@
"github.copilot.command.cli.sessions.resumeInTerminal": "Resume Agent Session in Terminal",
"github.copilot.cli.sessions.newTerminalSession": "New Agent Session in Terminal",
"github.copilot.command.openCopilotAgentSessionsInBrowser": "Open in Browser",
"github.copilot.command.closeChatSessionPullRequest.title": "Close Pull Request",
"copilot.tools.runSubagent.name": "Run Subagent",
"copilot.tools.runSubagent.description": "Runs a task within an isolated subagent context. Enables efficient organization of tasks and context window management."
"github.copilot.command.closeChatSessionPullRequest.title": "Close Pull Request"
}

View File

@@ -85,7 +85,7 @@ export class SubagentToolCallingLoop extends ToolCallingLoop<ISubagentToolCallin
}
protected async getAvailableTools(): Promise<LanguageModelToolInformation[]> {
const excludedTools = new Set([ToolName.RunSubagent, ToolName.CoreManageTodoList]);
const excludedTools = new Set([ToolName.CoreRunSubagent, ToolName.CoreManageTodoList]);
return (await getAgentTools(this.instantiationService, this.options.request))
.filter(tool => !excludedTools.has(tool.name as ToolName))
// TODO can't do virtual tools at this level

View File

@@ -66,7 +66,7 @@ export enum ToolName {
CoreRunTest = 'runTests',
ToolReplay = 'tool_replay',
EditFilesPlaceholder = 'edit_files',
RunSubagent = 'runSubagent',
CoreRunSubagent = 'runSubagent',
CoreConfirmationTool = 'vscode_get_confirmation',
CoreTerminalConfirmationTool = 'vscode_get_terminal_confirmation'
}
@@ -173,7 +173,7 @@ export const toolCategories: Record<ToolName, ToolCategory> = {
[ToolName.FindFiles]: ToolCategory.Core,
[ToolName.CreateDirectory]: ToolCategory.Core,
[ToolName.ReadProjectStructure]: ToolCategory.Core,
[ToolName.RunSubagent]: ToolCategory.Core,
[ToolName.CoreRunSubagent]: ToolCategory.Core,
[ToolName.Memory]: ToolCategory.Core,
// already enabled only when tasks are enabled

View File

@@ -29,7 +29,6 @@ import './readFileTool';
import './readProjectStructureTool';
import './replaceStringTool';
import './runNotebookCellTool';
import './runSubagentTool';
import './scmChangesTool';
import './searchWorkspaceSymbolsTool';
import './simpleBrowserTool';
@@ -39,4 +38,3 @@ import './usagesTool';
import './userPreferencesTool';
import './vscodeAPITool';
import './vscodeCmdTool';

View File

@@ -1,75 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import type * as vscode from 'vscode';
import { ChatResponseStreamImpl } from '../../../util/common/chatResponseStreamImpl';
import { IInstantiationService } from '../../../util/vs/platform/instantiation/common/instantiation';
import { ChatPrepareToolInvocationPart, ChatResponseNotebookEditPart, ChatResponseTextEditPart, ExtendedLanguageModelToolResult, LanguageModelTextPart } from '../../../vscodeTypes';
import { Conversation, Turn } from '../../prompt/common/conversation';
import { IBuildPromptContext } from '../../prompt/common/intents';
import { SubagentToolCallingLoop } from '../../prompt/node/subagentLoop';
import { ToolName } from '../common/toolNames';
import { CopilotToolMode, ICopilotTool, ToolRegistry } from '../common/toolsRegistry';
import { ChatFetchResponseType } from '../../../platform/chat/common/commonTypes';
export interface IRunSubagentParams {
prompt: string;
description: string;
}
class RunSubagentTool implements ICopilotTool<IRunSubagentParams> {
public static readonly toolName = ToolName.RunSubagent;
private _inputContext: IBuildPromptContext | undefined;
constructor(
@IInstantiationService private readonly instantiationService: IInstantiationService,
) { }
async invoke(options: vscode.LanguageModelToolInvocationOptions<IRunSubagentParams>, token: vscode.CancellationToken) {
const loop = this.instantiationService.createInstance(SubagentToolCallingLoop, {
toolCallLimit: 25,
conversation: new Conversation('', [new Turn('', { type: 'user', message: options.input.prompt })]),
request: this._inputContext!.request!,
location: this._inputContext!.request!.location,
promptText: options.input.prompt,
});
// I want to render this content as thinking blocks when we they include tool calls
const stream = this._inputContext?.stream && ChatResponseStreamImpl.filter(
this._inputContext.stream,
part => part instanceof ChatPrepareToolInvocationPart || part instanceof ChatResponseTextEditPart || part instanceof ChatResponseNotebookEditPart
);
const loopResult = await loop.run(stream, token);
// Return the text of the last assistant response from the tool calling loop, or request error
let subagentSummary = '';
if (loopResult.response.type === ChatFetchResponseType.Success) {
subagentSummary = loopResult.toolCallRounds.at(-1)?.response ?? loopResult.round.response ?? '';
} else {
subagentSummary = `The subagent request failed with this message:\n${loopResult.response.type}: ${loopResult.response.reason}`;
}
const result = new ExtendedLanguageModelToolResult([new LanguageModelTextPart(subagentSummary)]);
return result;
}
prepareInvocation(options: vscode.LanguageModelToolInvocationPrepareOptions<IRunSubagentParams>, token: vscode.CancellationToken): vscode.ProviderResult<vscode.PreparedToolInvocation> {
const { input } = options;
try {
return {
invocationMessage: input.description,
};
} catch {
return;
}
}
async resolveInput(input: IRunSubagentParams, promptContext: IBuildPromptContext, mode: CopilotToolMode): Promise<IRunSubagentParams> {
this._inputContext = promptContext;
return input;
}
}
ToolRegistry.registerTool(RunSubagentTool);