Skip to content

Conversation

@roblourens
Copy link
Member

@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?

Copilot AI review requested due to automatic review settings November 23, 2025 02:44
@roblourens roblourens enabled auto-merge November 23, 2025 02:44
@roblourens roblourens self-assigned this Nov 23, 2025
Copilot finished reviewing on behalf of roblourens November 23, 2025 02:46
@vs-code-engineering vs-code-engineering bot added this to the November 2025 milestone Nov 23, 2025
Copy link
Contributor

Copilot AI left a 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/GPT5CopilotIdentityRule and SafetyRules/Gpt5SafetyRule components 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>
Copy link

Copilot AI Nov 23, 2025

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.

Suggested change
return <InstructionMessage>
return <InstructionMessage>
You are an expert AI programming assistant, working with a user in the VS Code editor.<br />

Copilot uses AI. Check for mistakes.
class Gpt51CodexPrompt extends PromptElement<DefaultAgentPromptProps> {
async render(state: void, sizing: PromptSizing) {
const tools = detectToolCapabilities(this.props.availableTools);
return <InstructionMessage>
Copy link

Copilot AI Nov 23, 2025

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.

Suggested change
return <InstructionMessage>
return <InstructionMessage>
You are an expert AI programming assistant, working with a user in the VS Code editor.<br />

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants