Show workspace-level agent instruction files in 'configure instructions' picker#271952
Merged
Show workspace-level agent instruction files in 'configure instructions' picker#271952
Conversation
be86c4a to
76a8807
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the issue where workspace-level agent instruction files (copilot-instructions.md and AGENTS.md) were not appearing in the Chat Instructions dropdown dialog. The changes add dedicated service methods to list these files and integrate them into the file picker UI.
Key changes:
- Added new service methods
listAgentMDs()andlistCopilotInstructionsMDs()to filter and return agent instruction files based on feature flags - Integrated agent instruction files into the prompt file picker UI under a new "Agent Instructions" section
- Refactored instruction file detection logic from
ComputeAutomaticInstructionsto use the new centralized service methods
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.ts |
Added interface definitions for new methods to list agent instruction files |
src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.ts |
Implemented the new methods with feature flag checks |
src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.ts |
Added helper methods to find copilot-instructions.md and AGENTS.md files |
src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/promptFilePickers.ts |
Integrated agent instruction files into the picker UI with a new separator section |
src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.ts |
Refactored to use new centralized service methods instead of duplicated file search logic |
src/vs/workbench/contrib/chat/browser/chatWidget.ts |
Updated instruction file existence check to use new service methods |
src/vs/workbench/contrib/chat/test/common/mockPromptsService.ts |
Added stub implementations for new service methods |
src/vs/workbench/contrib/chat/test/common/promptSyntax/service/promptsService.test.ts |
Added test coverage for nested AGENTS.md behavior with feature flag |
src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/promptFilePickers.ts
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/promptFilePickers.ts
Outdated
Show resolved
Hide resolved
…ptsService.ts Co-authored-by: Copilot <[email protected]>
…mptFilePickers.ts Co-authored-by: Copilot <[email protected]>
0351468 to
4cab422
Compare
3cf3b9f to
8e62071
Compare
aeschli
approved these changes
Oct 20, 2025
aeschli
approved these changes
Oct 20, 2025
jruales
added a commit
that referenced
this pull request
Oct 31, 2025
#274393) Mitigates Issue #274004 (introduced in PR #271952) where ".github/instructions" was even showing up for other non-instruction pickers like the Prompts picker. Now we go back to showing "Workspace" With this change, the instructions picker will now have these three categories: * Workspace - includes scoped instruction files in the workspace. Before the change in this PR, this used to say ".github/instructions" * Agent Instructions - includes copilot-instructions.md and AGENTS.md files. * User Data - includes scoped instruction files at the user level
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes issue where
copilot-instructions.mdandAGENTS.mdweren't appearing in list of existing instruction files.Before the fix:

Open the "Chat Instructions" dialog
No copilot-instructions.md or AGENTS.md files are shown in the dropdown, even though both
<root>/.github/copilot-instructions.mdand<root>/AGENTS.mdexist:After the fix:
When it pops up, you will see that it now includes

copilot-instructions.mdfiles andAGENTS.mdfiles. This is what it looks like with "Use Nested Agents Md Files" on, showingcopilot-instructions.mdas well as threeAGENTS.mdfiles, each one listing the relative directory it's in:With "Use Nested Agents Md Files" off, it shows

copilot-instructions.mdand only the rootAGENTS.mdfile:Note that the "Workspace" section of the dialog (in blue) has been renamed to ".github/instructions", and the new section is named "Agent Instructions" to match the nearby "Generate agent instructions..." button.