-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Move all instructions into model-specific prompt #2156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR moves identity and safety instructions from a centralized location in agentPrompt.tsx into each model-specific prompt file. This allows customization of these foundational instructions per model family (e.g., GPT-5.1 codex can have different instructions than GPT-4). The change affects all agent prompt implementations and includes:
- Removal of shared instruction logic from
agentPrompt.tsx - Addition of
CopilotIdentityRules/GPT5CopilotIdentityRuleandSafetyRules/Gpt5SafetyRulecomponents to each model-specific prompt - Addition of an introductory sentence for most models
- Test updates including new test families (vscModelA, vscModelB) and updated snapshots
Reviewed changes
Copilot reviewed 56 out of 56 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
agentPrompt.tsx |
Removed centralized identity/safety rules logic; now delegates entirely to model-specific prompts |
xAIPrompts.tsx |
Added identity, safety rules, and intro sentence |
vscModelPrompts.tsx |
Added identity, safety rules, and intro sentence to both ModelA and ModelB |
gpt5Prompt.tsx |
Added GPT5-specific identity, safety rules, and intro sentence |
gpt5CodexPrompt.tsx |
Added GPT5-specific identity, safety rules, and intro sentence |
gpt51Prompt.tsx |
Added GPT5-specific identity and safety rules with custom context sentence |
gpt51CodexPrompt.tsx |
Added GPT5-specific identity and safety rules with custom context sentence |
defaultOpenAIPrompt.tsx |
Added identity, safety rules, and intro sentence |
geminiPrompts.tsx |
Added identity, safety rules, and intro sentence |
anthropicPrompts.tsx |
Added identity, safety rules, and intro sentence to both prompt variants |
defaultAgentInstructions.tsx |
Added identity, safety rules, and intro sentence |
agentPrompt.spec.tsx |
Added vscModelA and vscModelB to test families; changed assertion syntax |
| Snapshot files | 50+ new/updated snapshot files for test validation |
| class Gpt51Prompt extends PromptElement<DefaultAgentPromptProps> { | ||
| async render(state: void, sizing: PromptSizing) { | ||
| const tools = detectToolCapabilities(this.props.availableTools); | ||
| return <InstructionMessage> |
Copilot
AI
Nov 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The introductory sentence "You are an expert AI programming assistant, working with a user in the VS Code editor." is missing here but present in gpt5Prompt.tsx and gpt5CodexPrompt.tsx. This inconsistency means different GPT-5.1 models get different identity preambles. Add the missing introductory sentence before <GPT5CopilotIdentityRule /> for consistency, or document why this model should have a different introduction.
| return <InstructionMessage> | |
| return <InstructionMessage> | |
| You are an expert AI programming assistant, working with a user in the VS Code editor.<br /> |
| class Gpt51CodexPrompt extends PromptElement<DefaultAgentPromptProps> { | ||
| async render(state: void, sizing: PromptSizing) { | ||
| const tools = detectToolCapabilities(this.props.availableTools); | ||
| return <InstructionMessage> |
Copilot
AI
Nov 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The introductory sentence "You are an expert AI programming assistant, working with a user in the VS Code editor." is missing here but present in gpt5Prompt.tsx and gpt5CodexPrompt.tsx. This inconsistency means different GPT-5.1 models get different identity preambles. Add the missing introductory sentence before <GPT5CopilotIdentityRule /> for consistency, or document why this model should have a different introduction.
| return <InstructionMessage> | |
| return <InstructionMessage> | |
| You are an expert AI programming assistant, working with a user in the VS Code editor.<br /> |
@bhavyaus are you ok with this? I wanted to customize it for 5.1 codex. Or do you think these rules shouldn't be customizable so we don't drop them by accident?