Skip to content

Conversation

@jruales
Copy link
Contributor

@jruales jruales commented Oct 17, 2025

Fixes issue where copilot-instructions.md and AGENTS.md weren't appearing in list of existing instruction files.

Before the fix:
Open the "Chat Instructions" dialog
image

No copilot-instructions.md or AGENTS.md files are shown in the dropdown, even though both <root>/.github/copilot-instructions.md and <root>/AGENTS.md exist:

image

After the fix:

When it pops up, you will see that it now includes copilot-instructions.md files and AGENTS.md files. This is what it looks like with "Use Nested Agents Md Files" on, showing copilot-instructions.md as well as three AGENTS.md files, each one listing the relative directory it's in:
image

With "Use Nested Agents Md Files" off, it shows copilot-instructions.md and only the root AGENTS.md file:
image

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.

@jruales jruales force-pushed the dev/jruales/list-agent-instruction-files branch from be86c4a to 76a8807 Compare October 17, 2025 15:02
@jruales jruales requested a review from aeschli October 17, 2025 15:33
@jruales jruales marked this pull request as ready for review October 17, 2025 15:34
Copilot AI review requested due to automatic review settings October 17, 2025 15:34
Copy link
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

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() and listCopilotInstructionsMDs() 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 ComputeAutomaticInstructions to 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

@vs-code-engineering vs-code-engineering bot added this to the October 2025 milestone Oct 17, 2025
@jruales jruales force-pushed the dev/jruales/list-agent-instruction-files branch from 0351468 to 4cab422 Compare October 17, 2025 16:09
@aeschli aeschli changed the title Show workspace-level agent instruction files in dropdown Show workspace-level agent instruction files in 'configure instructions' picker Oct 20, 2025
@jruales jruales force-pushed the dev/jruales/list-agent-instruction-files branch from 3cf3b9f to 8e62071 Compare October 20, 2025 14:58
@aeschli aeschli merged commit 901240c into main Oct 20, 2025
28 checks passed
@aeschli aeschli deleted the dev/jruales/list-agent-instruction-files branch October 20, 2025 15:42
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
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Dec 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants