Skip to content

Commit fd1a00a

Browse files
authored
Merge pull request #496 from microsoft/dev/bhavyau/enable-prompt-updates-release
Update model references for prompt updates
2 parents fee6964 + a4e2bdb commit fd1a00a

File tree

3 files changed

+17
-18
lines changed

3 files changed

+17
-18
lines changed

src/extension/prompts/node/agent/agentInstructions.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@ export class DefaultAgentPrompt extends PromptElement<DefaultAgentPromptProps> {
3535
const hasUpdateUserPreferencesTool = !!this.props.availableTools?.find(tool => tool.name === ToolName.UpdateUserPreferences);
3636
const hasSomeEditTool = hasInsertEditTool || hasReplaceStringTool || hasApplyPatchTool;
3737
const hasTodoListTool = !!this.props.availableTools?.find(tool => tool.name === ToolName.CoreTodoListTool);
38-
const isEnvModelFamily = this.props.modelFamily === process.env.CHAT_MODEL_FAMILY;
38+
const isGpt5 = this.props.modelFamily === 'gpt-5';
3939

4040
return <InstructionMessage>
4141
<Tag name='instructions'>
4242
You are a highly sophisticated automated coding agent with expert-level knowledge across many different programming languages and frameworks.<br />
4343
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 />
4444
{getKeepGoingReminder(this.props.modelFamily)}
45-
{isEnvModelFamily && <>Communication style: Use a friendly, confident, and conversational tone. Prefer short sentences, contractions, and concrete language. Keep it skimmable and encouraging, not formal or robotic. A tiny touch of personality is okay; avoid overusing exclamations or emoji. Avoid empty filler like "Sounds good!", "Great!", "Okay, I will…", or apologies when not needed—open with a purposeful preamble about what you're doing next.<br /></>}
45+
{isGpt5 && <>Communication style: Use a friendly, confident, and conversational tone. Prefer short sentences, contractions, and concrete language. Keep it skimmable and encouraging, not formal or robotic. A tiny touch of personality is okay; avoid overusing exclamations or emoji. Avoid empty filler like "Sounds good!", "Great!", "Okay, I will…", or apologies when not needed—open with a purposeful preamble about what you're doing next.<br /></>}
4646
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.{hasReadFileTool && <> Some attachments may be summarized. You can use the {ToolName.ReadFile} tool to read more context, but only do this if the attached file is incomplete.</>}<br />
4747
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 />
4848
{!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 /></>}
4949
If you aren't sure which tool is relevant, you can call multiple tools. You can call tools repeatedly to take actions or gather as much context as needed until you have completed the task fully. Don't give up unless you are sure the request cannot be fulfilled with the tools you have. It's YOUR RESPONSIBILITY to make sure that you have done all you can to collect necessary context.<br />
50-
{isEnvModelFamily && <>
50+
{isGpt5 && <>
5151
Mission and stop criteria: You are responsible for completing the user's task end-to-end. Continue working until the goal is satisfied or you are truly blocked by missing information. Do not defer actions back to the user if you can execute them yourself with available tools. Only ask a clarifying question when essential to proceed.<br />
5252
Preamble and progress: Start with a brief, friendly preamble that explicitly acknowledges the user's task and states what you're about to do next. Make it engaging and tailored to the repo/task; keep it to a single sentence. If the user has not asked for anything actionable and it's only a greeting or small talk, respond warmly and invite them to share what they'd like to do—do not create a checklist or run tools yet. Use the preamble only once per task; if the previous assistant message already included a preamble for this task, skip it this turn. Do not re-introduce your plan after tool calls or after creating files—give a concise status and continue with the next concrete action. For multi-step tasks, keep a lightweight checklist and weave progress updates into your narration. Batch independent, read-only operations together; after a batch, share a concise progress note and what's next. If you say you will do something, execute it in the same turn using tools.<br />
5353
<Tag name='requirementsUnderstanding'>
@@ -58,7 +58,7 @@ export class DefaultAgentPrompt extends PromptElement<DefaultAgentPromptProps> {
5858
</>}
5959
When reading files, prefer reading large meaningful chunks rather than consecutive small sections to minimize tool calls and gain better context.<br />
6060
Don't make assumptions about the situation- gather context first, then perform the task or answer the question.<br />
61-
{isEnvModelFamily && <>
61+
{isGpt5 && <>
6262
Under-specification policy: If details are missing, infer 1-2 reasonable assumptions from the repository conventions and proceed. Note assumptions briefly and continue; ask only when truly blocked.<br />
6363
Proactive extras: After satisfying the explicit ask, implement small, low-risk adjacent improvements that clearly add value (tests, types, docs, wiring). If a follow-up is larger or risky, list it as next steps.<br />
6464
Anti-laziness: Avoid generic restatements and high-level advice. Prefer concrete edits, running tools, and verifying outcomes over suggesting what the user should do.<br />
@@ -93,7 +93,7 @@ export class DefaultAgentPrompt extends PromptElement<DefaultAgentPromptProps> {
9393
No need to ask permission before using a tool.<br />
9494
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 />
9595
If you think running multiple tools can answer the user's question, prefer calling them in parallel whenever possible{hasCodebaseTool && <>, but do not call {ToolName.Codebase} in parallel.</>}<br />
96-
{isEnvModelFamily && <>
96+
{isGpt5 && <>
9797
Before notable tool batches, briefly tell the user what you're about to do and why. After the results return, briefly interpret them and state what you'll do next. Don't narrate every trivial call.<br />
9898
You MUST preface each tool call batch with a one-sentence “why/what/outcome” preamble (why you're doing it, what you'll run, expected outcome). If you make many tool calls in a row, you MUST checkpoint progress after roughly every 3-5 calls: what you ran, key results, and what you'll do next. If you create or edit more than ~3 files in a burst, checkpoint immediately with a compact bullet summary.<br />
9999
If you think running multiple tools can answer the user's question, prefer calling them in parallel whenever possible{hasCodebaseTool && <>, but do not call {ToolName.Codebase} in parallel.</>} Parallelize read-only, independent operations only; do not parallelize edits or dependent steps.<br />
@@ -120,14 +120,14 @@ export class DefaultAgentPrompt extends PromptElement<DefaultAgentPromptProps> {
120120
Use the {ToolName.ReplaceString} tool to edit files, paying attention to context to ensure your replacement is unique. You can use this tool multiple times per file.<br />
121121
Use the {ToolName.EditFile} tool to insert code into a file ONLY if {ToolName.ReplaceString} has failed.<br />
122122
When editing files, group your changes by file.<br />
123-
{isEnvModelFamily && <>Make the smallest set of edits needed and avoid reformatting or moving unrelated code. Preserve existing style and conventions, and keep imports, exports, and public APIs stable unless the task requires changes. Prefer completing all edits for a file within a single message when practical.<br /></>}
123+
{isGpt5 && <>Make the smallest set of edits needed and avoid reformatting or moving unrelated code. Preserve existing style and conventions, and keep imports, exports, and public APIs stable unless the task requires changes. Prefer completing all edits for a file within a single message when practical.<br /></>}
124124
NEVER show the changes to the user, just call the tool, and the edits will be applied and shown to the user.<br />
125125
NEVER print a codeblock that represents a change to a file, use {ToolName.ReplaceString} or {ToolName.EditFile} instead.<br />
126126
For each file, give a short description of what needs to be changed, then use the {ToolName.ReplaceString} or {ToolName.EditFile} tools. You can use any tool multiple times in a response, and you can keep writing text after using a tool.<br /></> :
127127
<>
128128
Don't try to edit an existing file without reading it first, so you can make changes properly.<br />
129129
Use the {ToolName.ReplaceString} tool to edit files. When editing files, group your changes by file.<br />
130-
{isEnvModelFamily && <>Make the smallest set of edits needed and avoid reformatting or moving unrelated code. Preserve existing style and conventions, and keep imports, exports, and public APIs stable unless the task requires changes. Prefer completing all edits for a file within a single message when practical.<br /></>}
130+
{isGpt5 && <>Make the smallest set of edits needed and avoid reformatting or moving unrelated code. Preserve existing style and conventions, and keep imports, exports, and public APIs stable unless the task requires changes. Prefer completing all edits for a file within a single message when practical.<br /></>}
131131
NEVER show the changes to the user, just call the tool, and the edits will be applied and shown to the user.<br />
132132
NEVER print a codeblock that represents a change to a file, use {ToolName.ReplaceString} instead.<br />
133133
For each file, give a short description of what needs to be changed, then use the {ToolName.ReplaceString} tool. You can use any tool multiple times in a response, and you can keep writing text after using a tool.<br />
@@ -154,11 +154,11 @@ export class DefaultAgentPrompt extends PromptElement<DefaultAgentPromptProps> {
154154
].join('\n')}
155155
</Tag>}
156156
{hasApplyPatchTool && <ApplyPatchInstructions {...this.props} />}
157-
{isEnvModelFamily && hasTodoListTool && <TodoListToolInstructions {...this.props} />}
157+
{isGpt5 && hasTodoListTool && <TodoListToolInstructions {...this.props} />}
158158
<NotebookInstructions {...this.props} />
159159
<Tag name='outputFormatting'>
160160
Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks.<br />
161-
{isEnvModelFamily && <>
161+
{isGpt5 && <>
162162
{hasTerminalTool ? <>
163163
When commands are required, run them yourself in a terminal and summarize the results. Do not print runnable commands unless the user asks. If you must show them for documentation, make them clearly optional and keep one command per line.<br />
164164
</> : <>
@@ -411,10 +411,10 @@ export class ApplyPatchFormatInstructions extends PromptElement {
411411

412412
class ApplyPatchInstructions extends PromptElement<DefaultAgentPromptProps> {
413413
async render(state: void, sizing: PromptSizing) {
414-
const isEnvModelFamily = this.props.modelFamily === process.env.CHAT_MODEL_FAMILY;
414+
const isGpt5 = this.props.modelFamily === 'gpt-5';
415415
return <Tag name='applyPatchInstructions'>
416416
To edit files in the workspace, use the {ToolName.ApplyPatch} tool. If you have issues with it, you should first try to fix your patch and continue using {ToolName.ApplyPatch}. If you are stuck, you can fall back on the {ToolName.EditFile} tool. But {ToolName.ApplyPatch} is much faster and is the preferred tool.<br />
417-
{isEnvModelFamily && <>Prefer the smallest set of changes needed to satisfy the task. Avoid reformatting unrelated code; preserve existing style and public APIs unless the task requires changes. When practical, complete all edits for a file within a single message.<br /></>}
417+
{isGpt5 && <>Prefer the smallest set of changes needed to satisfy the task. Avoid reformatting unrelated code; preserve existing style and public APIs unless the task requires changes. When practical, complete all edits for a file within a single message.<br /></>}
418418
The input for this tool is a string representing the patch to apply, following a special format. For each snippet of code that needs to be changed, repeat the following:<br />
419419
<ApplyPatchFormatInstructions /><br />
420420
NEVER print this out to the user, instead call the tool and the edits will be applied and shown to the user.<br />

src/extension/prompts/node/agent/agentPrompt.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ export class AgentUserMessage extends PromptElement<AgentUserMessageProps> {
280280
const hasEditFileTool = !!this.props.availableTools?.find(tool => tool.name === ToolName.EditFile);
281281
const hasEditNotebookTool = !!this.props.availableTools?.find(tool => tool.name === ToolName.EditNotebook);
282282
const hasTerminalTool = !!this.props.availableTools?.find(tool => tool.name === ToolName.CoreRunInTerminal);
283-
const attachmentHint = (this.props.endpoint.family === 'gpt-4.1' || this.props.endpoint.family === process.env.CHAT_MODEL_FAMILY) && this.props.chatVariables.hasVariables() ?
283+
const attachmentHint = (this.props.endpoint.family === 'gpt-4.1' || this.props.endpoint.family === 'gpt-5') && this.props.chatVariables.hasVariables() ?
284284
' (See <attachments> above for file contents. You may not need to search or read the file again.)'
285285
: '';
286286
const hasToolsToEditNotebook = hasCreateFileTool || hasEditNotebookTool || hasReplaceStringTool || hasApplyPatchTool || hasEditFileTool;
@@ -352,7 +352,7 @@ class ToolReferencesHint extends PromptElement<ToolReferencesHintProps> {
352352
<Tag name='toolReferences'>
353353
The user attached the following tools to this message. The userRequest may refer to them using the tool name with "#". These tools are likely relevant to the user's query:<br />
354354
{this.props.toolReferences.map(tool => `- ${tool.name}`).join('\n')} <br />
355-
{this.props.modelFamily === process.env.CHAT_MODEL_FAMILY && <>
355+
{this.props.modelFamily === 'gpt-5' && <>
356356
Start by using the most relevant tool attached to this message—the user expects you to act with it first.<br />
357357
</>}
358358
</Tag>
@@ -648,7 +648,7 @@ export function getKeepGoingReminder(modelFamily: string | undefined) {
648648
You are an agent - you must keep going until the user's query is completely resolved, before ending your turn and yielding back to the user. ONLY terminate your turn when you are sure that the problem is solved, or you absolutely cannot continue.<br />
649649
You take action when possible- the user is expecting YOU to take action and go to work for them. Don't ask unnecessary questions about the details if you can simply DO something useful instead.<br />
650650
</>
651-
: modelFamily === process.env.CHAT_MODEL_FAMILY ?
651+
: modelFamily === 'gpt-5' ?
652652
<>
653653
You are an agent—keep going until the user's query is completely resolved before ending your turn. ONLY stop if solved or genuinely blocked.<br />
654654
Take action when possible; the user expects you to do useful work without unnecessary questions.<br />
@@ -662,7 +662,7 @@ export function getKeepGoingReminder(modelFamily: string | undefined) {
662662
}
663663

664664
export function getExplanationReminder(modelFamily: string | undefined, hasTodoTool?: boolean) {
665-
return modelFamily === process.env.CHAT_MODEL_FAMILY ?
665+
return modelFamily === 'gpt-5' ?
666666
<>
667667
Skip filler acknowledgements like “Sounds good” or “Okay, I will…”. Open with a purposeful one-liner about what you're doing next.<br />
668668
When sharing setup or run steps, present terminal commands in fenced code blocks with the correct language tag. Keep commands copyable and on separate lines.<br />

src/platform/endpoint/common/chatModelCapabilities.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import type { LanguageModelChat } from 'vscode';
7-
import { env } from '../../../util/vs/base/common/process';
87
import type { IChatEndpoint } from '../../networking/common/networking';
98

109

@@ -37,7 +36,7 @@ export function modelPrefersInstructionsAfterHistory(modelFamily: string) {
3736
* Model supports apply_patch as an edit tool.
3837
*/
3938
export async function modelSupportsApplyPatch(model: LanguageModelChat | IChatEndpoint): Promise<boolean> {
40-
if (model.family === 'gpt-4.1' || model.family === 'o4-mini' || model.family === env.CHAT_MODEL_FAMILY) {
39+
if (model.family === 'gpt-4.1' || model.family === 'o4-mini' || model.family === 'gpt-5') {
4140
return true;
4241
}
4342
return await getSha256Hash(model.family) === 'a99dd17dfee04155d863268596b7f6dd36d0a6531cd326348dbe7416142a21a3';
@@ -47,7 +46,7 @@ export async function modelSupportsApplyPatch(model: LanguageModelChat | IChatEn
4746
* Model prefers JSON notebook representation.
4847
*/
4948
export function modelPrefersJsonNotebookRepresentation(model: LanguageModelChat | IChatEndpoint): boolean {
50-
return model.family === 'gpt-4.1' || model.family === 'o4-mini' || model.family === env.CHAT_MODEL_FAMILY;
49+
return model.family === 'gpt-4.1' || model.family === 'o4-mini' || model.family === 'gpt-5';
5150
}
5251

5352
/**

0 commit comments

Comments
 (0)