Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 7 additions & 6 deletions src/extension/prompts/node/agent/agentPrompt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { BasePromptElementProps, Chunk, Image, PromptElement, PromptPiece, Promp
import type { ChatRequestEditedFileEvent, LanguageModelToolInformation, NotebookEditor, TaskDefinition, TextEditor } from 'vscode';
import { ChatLocation } from '../../../../platform/chat/common/commonTypes';
import { ConfigKey, IConfigurationService } from '../../../../platform/configuration/common/configurationService';
import { isHiddenModelB, isHiddenModelC, isHiddenModelD, isVSCModelA, modelNeedsStrongReplaceStringHint } from '../../../../platform/endpoint/common/chatModelCapabilities';
import { isHiddenModelB, isHiddenModelC, isHiddenModelD, isHiddenModelE, isVSCModelA, modelNeedsStrongReplaceStringHint } from '../../../../platform/endpoint/common/chatModelCapabilities';
import { CacheType } from '../../../../platform/endpoint/common/endpointTypes';
import { IEnvService, OperatingSystem } from '../../../../platform/env/common/envService';
import { getGitHubRepoInfoFromContext, IGitService } from '../../../../platform/git/common/gitService';
Expand Down Expand Up @@ -92,7 +92,7 @@ export class AgentPrompt extends PromptElement<AgentPromptProps> {
const baseAgentInstructions = <>
<SystemMessage>
You are an expert AI programming assistant, working with a user in the VS Code editor.<br />
{this.props.endpoint.family.startsWith('gpt-5') || this.props.endpoint.family.startsWith('arctic-fox') || await isHiddenModelB(this.props.endpoint) || await isHiddenModelC(this.props.endpoint) || await isHiddenModelD(this.props.endpoint) ? (
{this.props.endpoint.family.startsWith('gpt-5') || this.props.endpoint.family.startsWith('arctic-fox') || await isHiddenModelB(this.props.endpoint) || await isHiddenModelE(this.props.endpoint) || await isHiddenModelC(this.props.endpoint) || await isHiddenModelD(this.props.endpoint) ? (
<>
<GPT5CopilotIdentityRule />
<Gpt5SafetyRule />
Expand Down Expand Up @@ -410,7 +410,7 @@ class ToolReferencesHint extends PromptElement<ToolReferencesHintProps> {
<Tag name='toolReferences'>
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 />
{this.props.toolReferences.map(tool => `- ${tool.name}`).join('\n')} <br />
{(this.props.modelFamily?.startsWith('gpt-5') || this.props.modelFamily?.startsWith('arctic-fox') || await isHiddenModelB(this.props.modelFamily) || await isHiddenModelC(this.props.modelFamily) || await isHiddenModelD(this.props.modelFamily)) && <>
{(this.props.modelFamily?.startsWith('gpt-5') || this.props.modelFamily?.startsWith('arctic-fox') || await isHiddenModelB(this.props.modelFamily) || await isHiddenModelE(this.props.modelFamily) || await isHiddenModelC(this.props.modelFamily) || await isHiddenModelD(this.props.modelFamily)) && <>
Start by using the most relevant tool attached to this message—the user expects you to act with it first.<br />
</>}
</Tag>
Expand Down Expand Up @@ -726,7 +726,7 @@ export class KeepGoingReminder extends PromptElement<IKeepGoingReminderProps> {
}

async render(state: void, sizing: PromptSizing) {
if ((this.props.modelFamily === 'gpt-4.1' || this.props.modelFamily?.startsWith('gpt-5') || await isHiddenModelB(this.props.modelFamily)) && !(await isHiddenModelC(this.props.modelFamily) || await isHiddenModelD(this.props.modelFamily))) {
if ((this.props.modelFamily === 'gpt-4.1' || this.props.modelFamily?.startsWith('gpt-5') || await isHiddenModelB(this.props.modelFamily) || await isHiddenModelE(this.props.modelFamily)) && !(await isHiddenModelC(this.props.modelFamily) || await isHiddenModelD(this.props.modelFamily))) {
if (this.configurationService.getExperimentBasedConfig(ConfigKey.EnableAlternateGptPrompt, this.experimentationService)) {
// Extended reminder
return <>
Expand All @@ -741,7 +741,7 @@ export class KeepGoingReminder extends PromptElement<IKeepGoingReminderProps> {
</>;
} else if (this.props.modelFamily === 'gpt-5-codex') {
return undefined;
} else if (this.props.modelFamily?.startsWith('gpt-5') || await isHiddenModelB(this.props.modelFamily)) {
} else if (this.props.modelFamily?.startsWith('gpt-5') || await isHiddenModelB(this.props.modelFamily) || await isHiddenModelE(this.props.modelFamily)) {
return <>
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 />
Take action when possible; the user expects you to do useful work without unnecessary questions.<br />
Expand Down Expand Up @@ -789,7 +789,8 @@ async function getExplanationReminder(modelFamily: string | undefined, hasTodoTo

const isGpt5Mini = modelFamily === 'gpt-5-mini';
const isModelB = await isHiddenModelB(modelFamily);
return modelFamily?.startsWith('gpt-5') || isModelB ?
const isModelE = await isHiddenModelE(modelFamily);
return modelFamily?.startsWith('gpt-5') || isModelB || isModelE ?
<>
Skip filler acknowledgements like "Sounds good" or "Okay, I will…". Open with a purposeful one-liner about what you're doing next.<br />
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 />
Expand Down
6 changes: 3 additions & 3 deletions src/extension/prompts/node/agent/defaultAgentInstructions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { BasePromptElementProps, PromptElement, PromptSizing } from '@vscode/prompt-tsx';
import type { LanguageModelToolInformation } from 'vscode';
import { ConfigKey, IConfigurationService } from '../../../../platform/configuration/common/configurationService';
import { isHiddenModelB, isHiddenModelC, isHiddenModelD } from '../../../../platform/endpoint/common/chatModelCapabilities';
import { isHiddenModelB, isHiddenModelC, isHiddenModelD, isHiddenModelE } from '../../../../platform/endpoint/common/chatModelCapabilities';
import { IExperimentationService } from '../../../../platform/telemetry/common/nullExperimentationService';
import { LanguageModelToolMCPSource } from '../../../../vscodeTypes';
import { ToolName } from '../../../tools/common/toolNames';
Expand Down Expand Up @@ -402,11 +402,11 @@ export class ApplyPatchInstructions extends PromptElement<DefaultAgentPromptProp

async render(state: void, sizing: PromptSizing) {
const isGpt5 = this.props.modelFamily?.startsWith('gpt-5') === true;
const useSimpleInstructions = (isGpt5 || await isHiddenModelB(this.props.modelFamily) || await isHiddenModelC(this.props.modelFamily) || await isHiddenModelD(this.props.modelFamily) || this.props.modelFamily?.startsWith('arctic-fox')) && this.configurationService.getExperimentBasedConfig(ConfigKey.Internal.Gpt5AlternativePatch, this._experimentationService);
const useSimpleInstructions = (isGpt5 || await isHiddenModelB(this.props.modelFamily) || await isHiddenModelE(this.props.modelFamily) || await isHiddenModelC(this.props.modelFamily) || await isHiddenModelD(this.props.modelFamily) || this.props.modelFamily?.startsWith('arctic-fox')) && this.configurationService.getExperimentBasedConfig(ConfigKey.Internal.Gpt5AlternativePatch, this._experimentationService);

return <Tag name='applyPatchInstructions'>
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}. {this.props.tools[ToolName.EditFile] && <>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 />
{(isGpt5 || await isHiddenModelB(this.props.modelFamily) || await isHiddenModelC(this.props.modelFamily) || await isHiddenModelD(this.props.modelFamily) || this.props.modelFamily?.startsWith('arctic-fox')) && <>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 /></>}
{(isGpt5 || await isHiddenModelB(this.props.modelFamily) || await isHiddenModelE(this.props.modelFamily) || await isHiddenModelC(this.props.modelFamily) || await isHiddenModelD(this.props.modelFamily) || this.props.modelFamily?.startsWith('arctic-fox')) && <>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 /></>}
{!useSimpleInstructions && <>
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 />
<ApplyPatchFormatInstructions /><br />
Expand Down
Loading