diff --git a/src/extension/prompts/node/agent/agentPrompt.tsx b/src/extension/prompts/node/agent/agentPrompt.tsx index 30da7e78ab..fb65e3abb7 100644 --- a/src/extension/prompts/node/agent/agentPrompt.tsx +++ b/src/extension/prompts/node/agent/agentPrompt.tsx @@ -9,7 +9,6 @@ import { sessionResourceToId } from '../../../../platform/chat/common/chatDebugF import { ChatLocation } from '../../../../platform/chat/common/commonTypes'; import { ConfigKey, IConfigurationService } from '../../../../platform/configuration/common/configurationService'; import { ICustomInstructionsService } from '../../../../platform/customInstructions/common/customInstructionsService'; -import { USE_SKILL_ADHERENCE_PROMPT_SETTING } from '../../../../platform/customInstructions/common/promptTypes'; import { CacheType } from '../../../../platform/endpoint/common/endpointTypes'; import { IEnvService, OperatingSystem } from '../../../../platform/env/common/envService'; import { IIgnoreService } from '../../../../platform/ignore/common/ignoreService'; @@ -361,8 +360,7 @@ export class AgentUserMessage extends PromptElement { constructor( props: AgentUserMessageProps, @IPromptVariablesService private readonly promptVariablesService: IPromptVariablesService, - @ILogService private readonly logService: ILogService, - @IConfigurationService private readonly configurationService: IConfigurationService + @ILogService private readonly logService: ILogService ) { super(props); } @@ -429,7 +427,7 @@ export class AgentUserMessage extends PromptElement { {/* Critical reminders that are effective when repeated right next to the user message */} - {this.configurationService.getNonExtensionConfig(USE_SKILL_ADHERENCE_PROMPT_SETTING) && } + {query && diff --git a/src/extension/prompts/node/agent/test/agentPrompt.spec.tsx b/src/extension/prompts/node/agent/test/agentPrompt.spec.tsx index 017de088a3..24d8b4335e 100644 --- a/src/extension/prompts/node/agent/test/agentPrompt.spec.tsx +++ b/src/extension/prompts/node/agent/test/agentPrompt.spec.tsx @@ -183,6 +183,20 @@ testFamilies.forEach(family => { }, undefined)).toMatchFileSnapshot(getSnapshotFile('one_attachment')); }); + test('includes skill adherence reminder when instruction index has skills', async () => { + const prompt = await agentPromptToString(accessor, { + chatVariables: new ChatVariablesCollection([{ + id: 'vscode.customizations.index', + name: 'customizations index', + value: '/workspace/.github/skills/example/SKILL.md', + }]), + history: [], + query: 'hello', + }, undefined); + + expect(prompt).toContain("Always check if any skills apply to the user's request."); + }); + const tools: IBuildPromptContext['tools'] = { availableTools: [], toolInvocationToken: null as never, diff --git a/src/platform/customInstructions/common/promptTypes.ts b/src/platform/customInstructions/common/promptTypes.ts index aeb07244dc..ce1d856a81 100644 --- a/src/platform/customInstructions/common/promptTypes.ts +++ b/src/platform/customInstructions/common/promptTypes.ts @@ -19,7 +19,6 @@ export const SKILLS_LOCATION_KEY = 'chat.agentSkillsLocations'; export const WORKSPACE_SKILL_FOLDERS = ['.github/skills', '.claude/skills']; export const PERSONAL_SKILL_FOLDERS = ['.copilot/skills', '.claude/skills']; export const USE_AGENT_SKILLS_SETTING = 'chat.useAgentSkills'; -export const USE_SKILL_ADHERENCE_PROMPT_SETTING = 'chat.experimental.useSkillAdherencePrompt'; export const COPILOT_INSTRUCTIONS_PATH = '.github/copilot-instructions.md';