Skip to content

fix: emit agent instructions in CopilotCLI customization provider#4974

Merged
joshspicer merged 1 commit intomainfrom
josh/customization-provider-fixes
Apr 6, 2026
Merged

fix: emit agent instructions in CopilotCLI customization provider#4974
joshspicer merged 1 commit intomainfrom
josh/customization-provider-fixes

Conversation

@joshspicer
Copy link
Copy Markdown
Member

Companion to microsoft/vscode#307745.

The CopilotCLICustomizationProvider was missing "Agent Instructions" (AGENTS.md, CLAUDE.md, copilot-instructions.md) from its instruction items. These files come from customInstructionsService.getAgentInstructions() but are NOT in chatPromptFileService.instructions (which only has .instructions.md files). The provider used the agent instruction URIs as a filter set but never emitted them as items when they weren't also in chatPromptFileService.instructions.

Now emits agent instruction items first from getAgentInstructions(), then iterates chatPromptFileService.instructions while skipping any already-emitted URIs.

@joshspicer joshspicer marked this pull request as ready for review April 3, 2026 22:52
Copilot AI review requested due to automatic review settings April 3, 2026 22:52
…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.
@joshspicer joshspicer force-pushed the josh/customization-provider-fixes branch from 074ce45 to 271c739 Compare April 3, 2026 22:54
Copy link
Copy Markdown
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

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 iterating chatPromptFileService.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

@joshspicer joshspicer added this pull request to the merge queue Apr 6, 2026
Merged via the queue into main with commit bab22b9 Apr 6, 2026
19 checks passed
@joshspicer joshspicer deleted the josh/customization-provider-fixes branch April 6, 2026 02:07
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.

3 participants