豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit 1874990

Browse files
Copilotdigitarald
andauthored
Remove skill adherence prompt setting gate and always include reminder
Agent-Logs-Url: https://github.com/microsoft/vscode-copilot-chat/sessions/f9d6d7a6-729d-4e52-9abe-62f0c33a597b Co-authored-by: digitarald <8599+digitarald@users.noreply.github.com>
1 parent d2910bc commit 1874990

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { sessionResourceToId } from '../../../../platform/chat/common/chatDebugF
99
import { ChatLocation } from '../../../../platform/chat/common/commonTypes';
1010
import { ConfigKey, IConfigurationService } from '../../../../platform/configuration/common/configurationService';
1111
import { ICustomInstructionsService } from '../../../../platform/customInstructions/common/customInstructionsService';
12-
import { USE_SKILL_ADHERENCE_PROMPT_SETTING } from '../../../../platform/customInstructions/common/promptTypes';
1312
import { CacheType } from '../../../../platform/endpoint/common/endpointTypes';
1413
import { IEnvService, OperatingSystem } from '../../../../platform/env/common/envService';
1514
import { IIgnoreService } from '../../../../platform/ignore/common/ignoreService';
@@ -361,8 +360,7 @@ export class AgentUserMessage extends PromptElement<AgentUserMessageProps> {
361360
constructor(
362361
props: AgentUserMessageProps,
363362
@IPromptVariablesService private readonly promptVariablesService: IPromptVariablesService,
364-
@ILogService private readonly logService: ILogService,
365-
@IConfigurationService private readonly configurationService: IConfigurationService
363+
@ILogService private readonly logService: ILogService
366364
) {
367365
super(props);
368366
}
@@ -429,7 +427,7 @@ export class AgentUserMessage extends PromptElement<AgentUserMessageProps> {
429427
{/* Critical reminders that are effective when repeated right next to the user message */}
430428
<ReminderInstructionsClass {...reminderProps} />
431429
<NotebookReminderInstructions chatVariables={this.props.chatVariables} query={this.props.request} />
432-
{this.configurationService.getNonExtensionConfig<boolean>(USE_SKILL_ADHERENCE_PROMPT_SETTING) && <SkillAdherenceReminder chatVariables={this.props.chatVariables} />}
430+
<SkillAdherenceReminder chatVariables={this.props.chatVariables} />
433431
</Tag>
434432
{query && <Tag name={userQueryTagName} priority={900} flexGrow={7}>
435433
<UserQuery chatVariables={this.props.chatVariables} query={query} />

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,20 @@ testFamilies.forEach(family => {
183183
}, undefined)).toMatchFileSnapshot(getSnapshotFile('one_attachment'));
184184
});
185185

186+
test('includes skill adherence reminder when instruction index has skills', async () => {
187+
const prompt = await agentPromptToString(accessor, {
188+
chatVariables: new ChatVariablesCollection([{
189+
id: 'vscode.customizations.index',
190+
name: 'customizations index',
191+
value: '<skills><skill><file>/workspace/.github/skills/example/SKILL.md</file></skill></skills>',
192+
}]),
193+
history: [],
194+
query: 'hello',
195+
}, undefined);
196+
197+
expect(prompt).toContain("Always check if any skills apply to the user's request.");
198+
});
199+
186200
const tools: IBuildPromptContext['tools'] = {
187201
availableTools: [],
188202
toolInvocationToken: null as never,

src/platform/customInstructions/common/promptTypes.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export const SKILLS_LOCATION_KEY = 'chat.agentSkillsLocations';
1919
export const WORKSPACE_SKILL_FOLDERS = ['.github/skills', '.claude/skills'];
2020
export const PERSONAL_SKILL_FOLDERS = ['.copilot/skills', '.claude/skills'];
2121
export const USE_AGENT_SKILLS_SETTING = 'chat.useAgentSkills';
22-
export const USE_SKILL_ADHERENCE_PROMPT_SETTING = 'chat.experimental.useSkillAdherencePrompt';
2322

2423
export const COPILOT_INSTRUCTIONS_PATH = '.github/copilot-instructions.md';
2524

0 commit comments

Comments
 (0)