Skip to content

Commit f6ca93d

Browse files
authored
Add GPT-5 specific identity rule to agent prompt (#565)
1 parent ac0a380 commit f6ca93d

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { GlobalContextMessageMetadata, RenderedUserMessageMetadata, Turn } from
3131
import { InternalToolReference } from '../../../prompt/common/intents';
3232
import { IPromptVariablesService } from '../../../prompt/node/promptVariablesService';
3333
import { ToolName } from '../../../tools/common/toolNames';
34-
import { CopilotIdentityRules } from '../base/copilotIdentity';
34+
import { CopilotIdentityRules, GPT5CopilotIdentityRule } from '../base/copilotIdentity';
3535
import { IPromptEndpoint, renderPromptElement } from '../base/promptRenderer';
3636
import { SafetyRules } from '../base/safetyRules';
3737
import { Tag } from '../base/tag';
@@ -101,7 +101,7 @@ export class AgentPrompt extends PromptElement<AgentPromptProps> {
101101
const baseAgentInstructions = <>
102102
<SystemMessage>
103103
You are an expert AI programming assistant, working with a user in the VS Code editor.<br />
104-
<CopilotIdentityRules />
104+
{this.props.endpoint.family.startsWith('gpt-5') ? <GPT5CopilotIdentityRule /> : <CopilotIdentityRules />}
105105
<SafetyRules />
106106
</SystemMessage>
107107
{instructions}

src/extension/prompts/node/base/copilotIdentity.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,13 @@ export class CopilotIdentityRules extends PromptElement {
1515
);
1616
}
1717
}
18+
19+
export class GPT5CopilotIdentityRule extends PromptElement {
20+
render() {
21+
return (
22+
<>
23+
Your name is GitHub Copilot.<br />
24+
</>
25+
);
26+
}
27+
}

0 commit comments

Comments
 (0)