improve copilot AH customization discovery#318745
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the agent host’s Copilot customization discovery to better align with expected folder layouts, including support for discovering instruction files in nested directories and adding a user-home instructions root.
Changes:
- Adjust agent-folder discovery expectations around excluding
README.md. - Add discovery coverage for nested
*.instructions.mdfiles (workspace + user home). - Update
SessionCustomizationDiscoverysearch roots and scanning logic for instructions.
Show a summary per file
| File | Description |
|---|---|
| src/vs/platform/agentHost/test/node/sessionCustomizationDiscovery.test.ts | Updates/expands discovery tests (README handling, nested instructions). |
| src/vs/platform/agentHost/node/copilot/sessionCustomizationDiscovery.ts | Extends discovery roots and adds recursive scanning for instruction files; adjusts agent scanning behavior. |
Copilot's findings
Comments suppressed due to low confidence (1)
src/vs/platform/agentHost/node/copilot/sessionCustomizationDiscovery.ts:166
resolve(..., { resolveMetadata: true })pulls size/mtime/etag metadata for every child entry, but the discovery scan only needs directory entries and names. This can add unnecessary IO overhead on large folders or remote file systems; consider usingresolveMetadata: false(andIFileStat) here and in the recursive instruction traversal.
let stat: IFileStatWithMetadata;
try {
stat = await this._fileService.resolve(rootUri, { resolveMetadata: true });
} catch {
// Root does not exist (or is unreadable) — nothing to discover or watch.
return;
}
if (!stat.isDirectory || !stat.children) {
return;
- Files reviewed: 2/2 changed files
- Comments generated: 1
auto-merge was automatically disabled
May 28, 2026 13:47
Pull request was converted to draft
dmitrivMS
approved these changes
May 28, 2026
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.
No description provided.