Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
a5a8b5d
search subagent tool added
Nov 11, 2025
f89f525
cleaning up description of search subagent
Nov 11, 2025
5251e9a
additional changes
Nov 13, 2025
d29fff9
update linting issue
Nov 19, 2025
6541477
Exit early on search subagent call
Nov 21, 2025
7e6e0f1
search subagent tool added
Nov 11, 2025
258978d
cleaning up description of search subagent
Nov 11, 2025
d64f8e5
additional changes
Nov 13, 2025
88b1b4c
update linting issue
Nov 19, 2025
17c5395
Add fixes for subagent
Nov 24, 2025
ccef095
describe read file tool in its prompt
Nov 24, 2025
4c5caff
update prompt class type
Nov 25, 2025
7031d5f
Merge branch 'main' into anisha/search_subagent
Nov 25, 2025
ea48829
fixing copilot cli issues?
Nov 25, 2025
4f04523
resolved merge conflicts with main
Dec 4, 2025
d78875a
resolve merge conflicts with main
Dec 4, 2025
2fbff7d
explicit any pt 2
Dec 5, 2025
5b567cd
update explicit any to unknown
Dec 5, 2025
3b2a339
demo
zhichli Dec 5, 2025
e59c5de
merge main
24anisha Dec 11, 2025
0b9438e
updating prompt to include description
24anisha Dec 11, 2025
1c61c9e
fixing newline bug
24anisha Dec 11, 2025
b17d06d
added correct input params for subagent
24anisha Dec 11, 2025
d72da66
Merge branch 'main' into anisha/search_subagent
24anisha Dec 15, 2025
337ce2e
update to add final turn warning injection
24anisha Dec 15, 2025
5a18cde
code snippet hydration
24anisha Dec 16, 2025
8836814
adding details to toolMetadata (untested)
24anisha Dec 16, 2025
b14528d
Merge branch 'main' into anisha/search_subagent
24anisha Dec 16, 2025
0bf515e
commented out until testing
24anisha Dec 16, 2025
9e02d6e
Merge branch 'main' into anisha/search_subagent
24anisha Dec 17, 2025
1c9797f
Merge pull request #2 from vritant24/dev/vrbhardw/exitEarlyOnSearchSu…
24anisha Dec 17, 2025
54e16da
Merge branch 'anisha/search_subagent' of https://github.com/24anisha/…
24anisha Dec 17, 2025
77dae9a
remove exit from main PR
24anisha Dec 17, 2025
9f068a6
actuallly terminate loop
vritant24 Dec 22, 2025
8b7ffee
Merge pull request #3 from vritant24/dev/vrbhardw/terminateToolLoop
24anisha Dec 22, 2025
0d38b5b
end loop after round is added and run
vritant24 Dec 26, 2025
e00481d
Merge pull request #4 from vritant24/dev/vrbhardw/endToolCall
24anisha Jan 2, 2026
e6b1199
add search subagent to package nls
24anisha Jan 6, 2026
cc487fa
remove early exit handling
24anisha Jan 6, 2026
bbbc0ed
add experiment flags
24anisha Jan 7, 2026
46041cd
Merge branch 'main' into anisha/flight_searchagent
24anisha Jan 7, 2026
076da01
update code to check for exp + auto mode
24anisha Jan 7, 2026
c6a1b3f
update to only use gpt 5 mini for search subagent
24anisha Jan 7, 2026
efd7486
Merge branch 'main' into anisha/flight_searchagent
24anisha Jan 7, 2026
3c0d8f7
Update src/extension/prompts/node/agent/searchSubagentPrompt.tsx
24anisha Jan 7, 2026
9349052
Update docs/tools.md
24anisha Jan 7, 2026
b5df7d2
Update package.nls.json
24anisha Jan 7, 2026
5c51cef
update tests to handle new prompts
24anisha Jan 7, 2026
4c8ab2e
Merge branch 'main' into anisha/flight_searchagent
24anisha Jan 9, 2026
a6a2bf2
Apply suggestion from @Copilot
24anisha Jan 9, 2026
683bf3c
deleting vestigial file
24anisha Jan 9, 2026
563ecee
Merge branch 'anisha/flight_searchagent' of https://github.com/24anis…
24anisha Jan 9, 2026
526d379
fix merge conflict
24anisha Jan 9, 2026
3def81f
update to default to using the main agent model as fallback for subag…
24anisha Jan 9, 2026
a241f80
remove extra whitespace
24anisha Jan 9, 2026
91abd0d
Merge branch 'main' into anisha/flight_searchagent
24anisha Jan 9, 2026
dfa6cd1
Merge branch 'main' into anisha/flight_searchagent
24anisha Jan 12, 2026
f01c2f4
remove runSubagent from package.json and update prompt for final snip…
24anisha Jan 12, 2026
9d4a4b2
Merge branch 'anisha/flight_searchagent' of https://github.com/24anis…
24anisha Jan 12, 2026
9e4c248
reset default to false
24anisha Jan 12, 2026
f28e5fd
add clearer injection prompt
24anisha Jan 13, 2026
c819574
Merge branch 'main' into anisha/flight_searchagent
24anisha Jan 13, 2026
3e4998e
updating to work with main branch changes
24anisha Jan 13, 2026
4695ab0
rewrite search subagent to have its own tool calling loop file + ensu…
24anisha Jan 13, 2026
0e4bb5b
remove copilot-added search subagent doc
24anisha Jan 13, 2026
c94cd57
update toolResultMessage
24anisha Jan 13, 2026
367e292
handle exp configuration for search subagent in the right place
24anisha Jan 13, 2026
5929a6e
Merge branch 'main' into anisha/flight_searchagent
24anisha Jan 13, 2026
4ffd863
merge with main
24anisha Jan 14, 2026
beece09
use searchSubagentLoop instead of subagentLoop
24anisha Jan 14, 2026
55dc699
update to be in line with main
24anisha Jan 14, 2026
f463d21
remove CCA agents
24anisha Jan 14, 2026
bf4c5cf
Some minor cleanup
bhavyaus Jan 14, 2026
d540c5f
Merge branch 'main' into anisha/flight_searchagent
bhavyaus Jan 14, 2026
84a6ea0
Merge branch 'main' into anisha/flight_searchagent
bhavyaus Jan 14, 2026
5c2950e
Update import for ChatToolInvocationPart in SearchSubagentTool
bhavyaus Jan 14, 2026
ce57383
Merge branch 'main' into anisha/flight_searchagent
bhavyaus Jan 15, 2026
9eb218e
Merge branch 'main' into anisha/flight_searchagent
bhavyaus Jan 15, 2026
6a9a14d
Replace inSubAgent flag with subAgentInvocationId for tool calling lo…
bhavyaus Jan 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 46 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,40 @@
]
}
},
{
"name": "search_subagent",
"toolReferenceName": "searchSubagent",
"displayName": "%copilot.tools.searchSubagent.name%",
"icon": "$(search)",
"canBeReferencedInPrompt": true,
"userDescription": "%copilot.tools.searchSubagent.description%",
"modelDescription": "Launch an iterative search-focused subagent that orchestrates semantic_search, grep_search, file_search and read_file tool calls to explore and gather relevant workspace code for a natural language query.\n CALL THIS FOR ANY TASK THAT REQUIRES CODEBASE EXPLORATION!\n\nRemember:\n1. Perform tool calls in parallel whenever possible\n2. Avoid redundant calls -- don't repeat identical searches.\n3. Stop once you have high-confidence, non-duplicative snippets covering the query scope.\n\nReturns: A list of relevant files/snippet locations in the workspace.\n\nInput fields:\n- query: Natural language description of what to search for.\n- description: Short user-visible invocation message. \n- details: 2-3 sentences detailing the objective of the search agent.",
"tags": [
"vscode_codesearch"
],
"inputSchema": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "Natural language description of what to search for."
},
"description": {
"type": "string",
"description": "A short (3-5 word) description of the task."
},
"details": {
"type": "string",
"description": "A more detailed description of the objective for the search subagent. This helps the sub-agent remain on task and understand its purpose."
}
},
"required": [
"query",
"description",
"details"
]
}
},
{
"name": "copilot_searchWorkspaceSymbols",
"toolReferenceName": "symbols",
Expand Down Expand Up @@ -1234,7 +1268,8 @@
"listDirectory",
"searchResults",
"textSearch",
"usages"
"usages",
"searchSubagent"
]
},
{
Expand Down Expand Up @@ -3921,6 +3956,16 @@
"advanced",
"experimental"
]
},
"github.copilot.chat.searchSubagent.enabled": {
"type": "boolean",
"default": false,
"markdownDescription": "%github.copilot.config.searchSubagent.enabled%",
"tags": [
"advanced",
"experimental",
"onExp"
]
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -377,5 +377,10 @@
"github.copilot.config.githubMcpServer.enabled": "Enable built-in support for the GitHub MCP Server.",
"github.copilot.config.githubMcpServer.toolsets": "Specify toolsets to use from the GitHub MCP Server. [Learn more](https://aka.ms/vscode-gh-mcp-toolsets).",
"github.copilot.config.githubMcpServer.readonly": "Enable read-only mode for the GitHub MCP Server. When enabled, only read tools are available. [Learn more](https://aka.ms/vscode-gh-mcp-readonly).",
"github.copilot.config.githubMcpServer.lockdown": "Enable lockdown mode for the GitHub MCP Server. When enabled, hides public issue details created by users without push access. [Learn more](https://aka.ms/vscode-gh-mcp-lockdown)."
"github.copilot.config.githubMcpServer.lockdown": "Enable lockdown mode for the GitHub MCP Server. When enabled, hides public issue details created by users without push access. [Learn more](https://aka.ms/vscode-gh-mcp-lockdown).",
"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.",
"copilot.tools.searchSubagent.name": "Search Subagent",
"copilot.tools.searchSubagent.description": "Launch an iterative search-focused subagent to find relevant code in your workspace.",
"github.copilot.config.searchSubagent.enabled": "Enable the search subagent tool for iterative code exploration in the workspace."
}
3 changes: 2 additions & 1 deletion src/extension/intents/node/agentIntent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { BudgetExceededError } from '@vscode/prompt-tsx/dist/base/materialized';
import type * as vscode from 'vscode';
import { ChatLocation, ChatResponse } from '../../../platform/chat/common/commonTypes';
import { ConfigKey, IConfigurationService } from '../../../platform/configuration/common/configurationService';
import { isAnthropicFamily, modelCanUseApplyPatchExclusively, modelCanUseReplaceStringExclusively, modelSupportsApplyPatch, modelSupportsMultiReplaceString, modelSupportsReplaceString, modelSupportsSimplifiedApplyPatchInstructions } from '../../../platform/endpoint/common/chatModelCapabilities';
import { isAnthropicFamily, isGptFamily, modelCanUseApplyPatchExclusively, modelCanUseReplaceStringExclusively, modelSupportsApplyPatch, modelSupportsMultiReplaceString, modelSupportsReplaceString, modelSupportsSimplifiedApplyPatchInstructions } from '../../../platform/endpoint/common/chatModelCapabilities';
import { IEndpointProvider } from '../../../platform/endpoint/common/endpointProvider';
import { IEnvService } from '../../../platform/env/common/envService';
import { ILogService } from '../../../platform/log/common/logService';
Expand Down Expand Up @@ -88,6 +88,7 @@ export const getAgentTools = async (accessor: ServicesAccessor, request: vscode.

allowTools[ToolName.CoreRunTest] = await testService.hasAnyTests();
allowTools[ToolName.CoreRunTask] = tasksService.getTasks().length > 0;
allowTools[ToolName.SearchSubagent] = (isGptFamily(model) || isAnthropicFamily(model)) && configurationService.getExperimentBasedConfig(ConfigKey.Advanced.SearchSubagentToolEnabled, experimentationService);

if (model.family.includes('grok-code')) {
allowTools[ToolName.CoreManageTodoList] = false;
Expand Down
121 changes: 121 additions & 0 deletions src/extension/prompt/node/searchSubagentToolCallingLoop.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { randomUUID } from 'crypto';
import type { CancellationToken, ChatRequest, ChatResponseStream, LanguageModelToolInformation, Progress } from 'vscode';
import { IAuthenticationChatUpgradeService } from '../../../platform/authentication/common/authenticationUpgrade';
import { ChatLocation, ChatResponse } from '../../../platform/chat/common/commonTypes';
import { IConfigurationService } from '../../../platform/configuration/common/configurationService';
import { IEndpointProvider } from '../../../platform/endpoint/common/endpointProvider';
import { ILogService } from '../../../platform/log/common/logService';
import { IRequestLogger } from '../../../platform/requestLogger/node/requestLogger';
import { IExperimentationService } from '../../../platform/telemetry/common/nullExperimentationService';
import { ITelemetryService } from '../../../platform/telemetry/common/telemetry';
import { IInstantiationService } from '../../../util/vs/platform/instantiation/common/instantiation';
import { ChatResponseProgressPart, ChatResponseReferencePart } from '../../../vscodeTypes';
import { IToolCallingLoopOptions, ToolCallingLoop, ToolCallingLoopFetchOptions } from '../../intents/node/toolCallingLoop';
import { SearchSubagentPrompt } from '../../prompts/node/agent/searchSubagentPrompt';
import { PromptRenderer } from '../../prompts/node/base/promptRenderer';
import { ToolName } from '../../tools/common/toolNames';
import { IToolsService } from '../../tools/common/toolsService';
import { IBuildPromptContext } from '../common/intents';
import { IBuildPromptResult } from './intents';

export interface ISearchSubagentToolCallingLoopOptions extends IToolCallingLoopOptions {
request: ChatRequest;
location: ChatLocation;
promptText: string;
}

export class SearchSubagentToolCallingLoop extends ToolCallingLoop<ISearchSubagentToolCallingLoopOptions> {

public static readonly ID = 'searchSubagentTool';

constructor(
options: ISearchSubagentToolCallingLoopOptions,
@IInstantiationService private readonly instantiationService: IInstantiationService,
@ILogService logService: ILogService,
@IRequestLogger requestLogger: IRequestLogger,
@IEndpointProvider private readonly endpointProvider: IEndpointProvider,
@IToolsService private readonly toolsService: IToolsService,
@IAuthenticationChatUpgradeService authenticationChatUpgradeService: IAuthenticationChatUpgradeService,
@ITelemetryService telemetryService: ITelemetryService,
@IConfigurationService configurationService: IConfigurationService,
@IExperimentationService experimentationService: IExperimentationService,
) {
super(options, instantiationService, endpointProvider, logService, requestLogger, authenticationChatUpgradeService, telemetryService, configurationService, experimentationService);
}

protected override createPromptContext(availableTools: LanguageModelToolInformation[], outputStream: ChatResponseStream | undefined): IBuildPromptContext {
const context = super.createPromptContext(availableTools, outputStream);
if (context.tools) {
context.tools = {
...context.tools,
toolReferences: [],
subAgentInvocationId: randomUUID()
};
}
context.query = this.options.promptText;
return context;
}

private async getEndpoint(request: ChatRequest) {
let endpoint = await this.endpointProvider.getChatEndpoint(this.options.request);
if (!endpoint.supportsToolCalls) {
endpoint = await this.endpointProvider.getChatEndpoint('gpt-4.1');
}
return endpoint;
}

protected async buildPrompt(buildPromptContext: IBuildPromptContext, progress: Progress<ChatResponseReferencePart | ChatResponseProgressPart>, token: CancellationToken): Promise<IBuildPromptResult> {
const endpoint = await this.getEndpoint(this.options.request);
const renderer = PromptRenderer.create(
this.instantiationService,
endpoint,
SearchSubagentPrompt,
{
promptContext: buildPromptContext
}
);
return await renderer.render(progress, token);
}

protected async getAvailableTools(): Promise<LanguageModelToolInformation[]> {
const endpoint = await this.getEndpoint(this.options.request);
const allTools = this.toolsService.getEnabledTools(this.options.request, endpoint);

// Only include tools relevant for search operations.
// We include semantic_search (Codebase) and the basic search primitives.
// The Codebase tool checks for inSubAgent context to prevent nested tool calling loops.
const allowedSearchTools = new Set([
ToolName.Codebase, // Semantic search
ToolName.FindFiles,
ToolName.FindTextInFiles,
ToolName.ReadFile
]);

return allTools.filter(tool => allowedSearchTools.has(tool.name as ToolName));
}

protected async fetch({ messages, finishedCb, requestOptions }: ToolCallingLoopFetchOptions, token: CancellationToken): Promise<ChatResponse> {
const endpoint = await this.getEndpoint(this.options.request);
return endpoint.makeChatRequest2({
debugName: SearchSubagentToolCallingLoop.ID,
messages,
finishedCb,
location: this.options.location,
requestOptions: {
...requestOptions,
temperature: 0
},
// This loop is inside a tool called from another request, so never user initiated
userInitiatedRequest: false,
telemetryProperties: {
messageId: randomUUID(),
messageSource: SearchSubagentToolCallingLoop.ID
},
}, token);
}
}
2 changes: 2 additions & 0 deletions src/extension/prompts/node/agent/anthropicPrompts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class DefaultAnthropicAgentPrompt extends PromptElement<DefaultAgentPromptProps>
<Tag name='instructions'>
You are a highly sophisticated automated coding agent with expert-level knowledge across many different programming languages and frameworks.<br />
The user will ask a question, or ask you to perform a task, and it may require lots of research to answer correctly. There is a selection of tools that let you perform actions or retrieve helpful context to answer the user's question.<br />
{tools[ToolName.SearchSubagent] && <>For codebase exploration, prefer {ToolName.SearchSubagent} to search and gather data instead of directly calling {ToolName.FindTextInFiles}, {ToolName.Codebase} or {ToolName.FindFiles}.<br /></>}
You will be given some context and attachments along with the user prompt. You can use them if they are relevant to the task, and ignore them if not.{tools[ToolName.ReadFile] && <> Some attachments may be summarized with omitted sections like `/* Lines 123-456 omitted */`. You can use the {ToolName.ReadFile} tool to read more context if needed. Never pass this omitted line marker to an edit tool.</>}<br />
If you can infer the project type (languages, frameworks, and libraries) from the user's query or the context that you have, make sure to keep them in mind when making changes.<br />
{!this.props.codesearchMode && <>If the user wants you to implement a feature and they have not specified the files to edit, first break down the user's request into smaller concepts and think about the kinds of files you need to grasp each concept.<br /></>}
Expand Down Expand Up @@ -149,6 +150,7 @@ class Claude45DefaultPrompt extends PromptElement<DefaultAgentPromptProps> {
No need to ask permission before using a tool.<br />
NEVER say the name of a tool to a user. For example, instead of saying that you'll use the {ToolName.CoreRunInTerminal} tool, say "I'll run the command in a terminal".<br />
If you think running multiple tools can answer the user's question, prefer calling them in parallel whenever possible{tools[ToolName.Codebase] && <>, but do not call {ToolName.Codebase} in parallel.</>}<br />
{tools[ToolName.SearchSubagent] && <>For codebase exploration, prefer {ToolName.SearchSubagent} to search and gather data instead of directly calling {ToolName.FindTextInFiles}, {ToolName.Codebase} or {ToolName.FindFiles}.<br /></>}
{tools[ToolName.ReadFile] && <>When using the {ToolName.ReadFile} tool, prefer reading a large section over calling the {ToolName.ReadFile} tool many times in sequence. You can also think of all the pieces you may be interested in and read them in parallel. Read large enough context to ensure you get what you need.<br /></>}
{tools[ToolName.Codebase] && <>If {ToolName.Codebase} returns the full contents of the text files in the workspace, you have all the workspace context.<br /></>}
{tools[ToolName.FindTextInFiles] && <>You can use the {ToolName.FindTextInFiles} to get an overview of a file by searching for a string within that one file, instead of using {ToolName.ReadFile} many times.<br /></>}
Expand Down
2 changes: 2 additions & 0 deletions src/extension/prompts/node/agent/defaultAgentInstructions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export class DefaultAgentPrompt extends PromptElement<DefaultAgentPromptProps> {
<Tag name='instructions'>
You are a highly sophisticated automated coding agent with expert-level knowledge across many different programming languages and frameworks.<br />
The user will ask a question, or ask you to perform a task, and it may require lots of research to answer correctly. There is a selection of tools that let you perform actions or retrieve helpful context to answer the user's question.<br />
{tools[ToolName.SearchSubagent] && <>For any context searching, use {ToolName.SearchSubagent} to search and gather data instead of directly calling {ToolName.FindTextInFiles}, {ToolName.Codebase} or {ToolName.FindFiles}.<br /></>}
You will be given some context and attachments along with the user prompt. You can use them if they are relevant to the task, and ignore them if not.{tools[ToolName.ReadFile] && <> Some attachments may be summarized with omitted sections like `/* Lines 123-456 omitted */`. You can use the {ToolName.ReadFile} tool to read more context if needed. Never pass this omitted line marker to an edit tool.</>}<br />
If you can infer the project type (languages, frameworks, and libraries) from the user's query or the context that you have, make sure to keep them in mind when making changes.<br />
{!this.props.codesearchMode && <>If the user wants you to implement a feature and they have not specified the files to edit, first break down the user's request into smaller concepts and think about the kinds of files you need to grasp each concept.<br /></>}
Expand All @@ -132,6 +133,7 @@ export class DefaultAgentPrompt extends PromptElement<DefaultAgentPromptProps> {
When using a tool, follow the JSON schema very carefully and make sure to include ALL required properties.<br />
No need to ask permission before using a tool.<br />
NEVER say the name of a tool to a user. For example, instead of saying that you'll use the {ToolName.CoreRunInTerminal} tool, say "I'll run the command in a terminal".<br />
{tools[ToolName.SearchSubagent] && <>For any context searching, use {ToolName.SearchSubagent} to search and gather data instead of directly calling {ToolName.FindTextInFiles}, {ToolName.Codebase} or {ToolName.FindFiles}.<br /></>}
If you think running multiple tools can answer the user's question, prefer calling them in parallel whenever possible{tools[ToolName.Codebase] && <>, but do not call {ToolName.Codebase} in parallel.</>}<br />
{tools[ToolName.ReadFile] && <>When using the {ToolName.ReadFile} tool, prefer reading a large section over calling the {ToolName.ReadFile} tool many times in sequence. You can also think of all the pieces you may be interested in and read them in parallel. Read large enough context to ensure you get what you need.<br /></>}
{tools[ToolName.Codebase] && <>If {ToolName.Codebase} returns the full contents of the text files in the workspace, you have all the workspace context.<br /></>}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export class DefaultOpenAIAgentPrompt extends PromptElement<DefaultAgentPromptPr
You are a highly sophisticated automated coding agent with expert-level knowledge across many different programming languages and frameworks.<br />
The user will ask a question, or ask you to perform a task, and it may require lots of research to answer correctly. There is a selection of tools that let you perform actions or retrieve helpful context to answer the user's question.<br />
<DefaultOpenAIKeepGoingReminder />
{tools[ToolName.SearchSubagent] && <>For codebase exploration, prefer {ToolName.SearchSubagent} to search and gather data instead of directly calling {ToolName.FindTextInFiles}, {ToolName.Codebase} or {ToolName.FindFiles}.<br /></>}
You will be given some context and attachments along with the user prompt. You can use them if they are relevant to the task, and ignore them if not.{tools[ToolName.ReadFile] && <> Some attachments may be summarized with omitted sections like `/* Lines 123-456 omitted */`. You can use the {ToolName.ReadFile} tool to read more context if needed. Never pass this omitted line marker to an edit tool.</>}<br />
If you can infer the project type (languages, frameworks, and libraries) from the user's query or the context that you have, make sure to keep them in mind when making changes.<br />
{!this.props.codesearchMode && <>If the user wants you to implement a feature and they have not specified the files to edit, first break down the user's request into smaller concepts and think about the kinds of files you need to grasp each concept.<br /></>}
Expand Down
1 change: 1 addition & 0 deletions src/extension/prompts/node/agent/openai/gpt51Prompt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ class Gpt51Prompt extends PromptElement<DefaultAgentPromptProps> {
- Working on the repo(s) in the current environment is allowed, even if they are proprietary.<br />
- Analyzing code for vulnerabilities is allowed.<br />
- Showing user code and tool call details is allowed.<br />
{tools[ToolName.SearchSubagent] && <>For codebase exploration, prefer {ToolName.SearchSubagent} to search and gather data instead of directly calling {ToolName.FindTextInFiles}, {ToolName.Codebase} or {ToolName.FindFiles}.<br /></>}
- Use the {ToolName.ApplyPatch} tool to edit files (NEVER try `applypatch` or `apply-patch`, only `apply_patch`): {`{"input":"*** Begin Patch\\n*** Update File: path/to/file.py\\n@@ def example():\\n- pass\\n+ return 123\\n*** End Patch"}`}.<br />
<br />
If completing the user's task requires writing or modifying files, your code and final answer should follow these coding guidelines, though user instructions (i.e. copilot-instructions.md) may override these guidelines:<br />
Expand Down
Loading