fix: emit agent instructions in CopilotCLI customization provider#4974
Merged
joshspicer merged 1 commit intomainfrom Apr 6, 2026
Merged
fix: emit agent instructions in CopilotCLI customization provider#4974joshspicer merged 1 commit intomainfrom
joshspicer merged 1 commit intomainfrom
Conversation
…ons.md) The provider only iterated chatPromptFileService.instructions, which contains .instructions.md files. Agent instruction files (AGENTS.md, CLAUDE.md, copilot-instructions.md) come from customInstructionsService.getAgentInstructions() and were used as a filter set but never emitted as items when they weren't also in chatPromptFileService.instructions. Now emits agent instructions from getAgentInstructions() first, then iterates chatPromptFileService.instructions while skipping any already emitted URIs.
074ce45 to
271c739
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the Copilot CLI chat customization provider so it actually emits “Agent Instructions” (e.g., AGENTS.md, CLAUDE.md, copilot-instructions.md) that come from customInstructionsService.getAgentInstructions(), even when those files are not present in chatPromptFileService.instructions.
Changes:
- Emit agent-instruction items directly from
getAgentInstructions()before iteratingchatPromptFileService.instructions. - De-dupe instruction items by skipping URIs already emitted as agent instructions.
- Add a unit test covering agent instructions that are not present in
chatPromptFileService.instructions.
Show a summary per file
| File | Description |
|---|---|
| src/extension/chatSessions/vscode-node/copilotCLICustomizationProvider.ts | Emits agent instruction items from getAgentInstructions() and avoids duplicates when iterating prompt-file instructions. |
| src/extension/chatSessions/vscode-node/test/copilotCLICustomizationProvider.spec.ts | Adds coverage to ensure agent instructions are emitted even when not in chatPromptFileService.instructions. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 2
roblourens
approved these changes
Apr 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Companion to microsoft/vscode#307745.
The
CopilotCLICustomizationProviderwas missing "Agent Instructions" (AGENTS.md, CLAUDE.md, copilot-instructions.md) from its instruction items. These files come fromcustomInstructionsService.getAgentInstructions()but are NOT inchatPromptFileService.instructions(which only has.instructions.mdfiles). The provider used the agent instruction URIs as a filter set but never emitted them as items when they weren't also inchatPromptFileService.instructions.Now emits agent instruction items first from
getAgentInstructions(), then iterateschatPromptFileService.instructionswhile skipping any already-emitted URIs.