fix: exempt agent instructions from workspace subpath filter#307937
Merged
joshspicer merged 2 commits intomainfrom Apr 6, 2026
Merged
fix: exempt agent instructions from workspace subpath filter#307937joshspicer merged 2 commits intomainfrom
joshspicer merged 2 commits intomainfrom
Conversation
AGENTS.md, CLAUDE.md, and copilot-instructions.md live at the workspace root by design. The CLI harness restricts items to workspaceSubpaths (.github, .copilot, .agents, .claude) which filtered out these root-level agent instruction files. Now items with groupKey 'agent-instructions' are exempt from the subpath filter, matching the existing exemption for instructionFileFilter patterns.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes discovery/filtering of workspace-root agent instruction files in the AI Customization list when using the core (non-provider) harness path. It exempts items categorized as groupKey: 'agent-instructions' from the active harness workspaceSubpaths restriction so files like AGENTS.md, CLAUDE.md, and copilot-instructions.md aren’t incorrectly hidden.
Changes:
- Exempt
agent-instructionsitems from the workspace subpath filter applied in the core item fetch pipeline.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.ts | Keeps agent-instructions items visible even when workspaceSubpaths filtering would otherwise hide workspace-root instruction files. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 0
The sessions AI customization tree view and overview were only calling listPromptFiles(PromptsType.instructions) to discover instruction files. However, AGENTS.md (along with CLAUDE.md and copilot-instructions.md) is classified as an agent type by getPromptFileType(), so it was never returned by that call. Fix by also calling listAgentInstructions() and merging the results (deduplicating by URI), matching the pattern already used by the workbench customization editor. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
justschen
approved these changes
Apr 6, 2026
yogeshwaran-c
pushed a commit
to yogeshwaran-c/vscode
that referenced
this pull request
Apr 6, 2026
…ft#307937) * fix: exempt agent instructions from workspace subpath filter AGENTS.md, CLAUDE.md, and copilot-instructions.md live at the workspace root by design. The CLI harness restricts items to workspaceSubpaths (.github, .copilot, .agents, .claude) which filtered out these root-level agent instruction files. Now items with groupKey 'agent-instructions' are exempt from the subpath filter, matching the existing exemption for instructionFileFilter patterns. * sessions: include AGENTS.md in instructions listing The sessions AI customization tree view and overview were only calling listPromptFiles(PromptsType.instructions) to discover instruction files. However, AGENTS.md (along with CLAUDE.md and copilot-instructions.md) is classified as an agent type by getPromptFileType(), so it was never returned by that call. Fix by also calling listAgentInstructions() and merging the results (deduplicating by URI), matching the pattern already used by the workbench customization editor. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Follow-up to #307745.
AGENTS.md, CLAUDE.md, and copilot-instructions.md live at the workspace root by design. The CLI harness restricts items to
workspaceSubpaths(.github,.copilot,.agents,.claude), which filtered out these root-level agent instruction files in the core path (used by the Sessions window whereproviderApi.enabledis false).Items with
groupKey: 'agent-instructions'are now exempt from the workspace subpath filter, matching the existing exemption pattern forinstructionFileFilter.Sessions window → Customizations → Instructions → AGENTS.md should appear under "Agent Instructions" (it was filtered out by the workspace subpath check)
Sessions window → Sidebar tree → Instructions section should list AGENTS.md
Sessions window → Overview badge count for Instructions should include AGENTS.md (e.g. 13 not 10)