-
Notifications
You must be signed in to change notification settings - Fork 36.7k
Show workspace-level agent instruction files in 'configure instructions' picker #271952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
be86c4a to
76a8807
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
#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
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.