Copilot AH: show hooks in customizations#322097
Open
aeschli wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the Agent Host “customizations” pipeline to include hook files as first-class discovered customizations, so they can be surfaced alongside agents/skills/instructions in the workbench’s customizations UI and covered by agent-host discovery tests.
Changes:
- Add
Hooksupport to agent-host discovery (DiscoveredType.Hook) including scanning.github/hooksand~/.copilot/hooks, plus fixed hook settings files (e.g..github/copilot/settings*.json,.claude/settings*.json). - Map discovered hook files into protocol-level
CustomizationType.Hookchildren and workbench-side prompt typing (PromptsType.hook). - Expand and update unit tests to cover discovery, watching, and bundling of hook files.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationItemProvider.ts | Maps CustomizationType.Hook → PromptsType.hook so directory-discovered hooks can be rendered in the customizations UI. |
| src/vs/platform/agentHost/test/node/sessionCustomizationDiscovery.test.ts | Adds coverage for hook discovery (workspace + user), nested hook files, fixed settings files, and watcher behavior. |
| src/vs/platform/agentHost/node/shared/sessionPluginBundler.ts | Adds bundling path mapping for discovered hook files into the synthetic plugin tree. |
| src/vs/platform/agentHost/node/copilot/sessionCustomizationDiscovery.ts | Introduces DiscoveredType.Hook, hook search roots, fixed hook settings discovery, and recursive scanning for *.json hook files. |
| src/vs/platform/agentHost/node/copilot/copilotAgent.ts | Maps discovered hook directories/files into CustomizationType.Hook child customizations. |
Copilot's findings
- Files reviewed: 5/5 changed files
- Comments generated: 2
Comment on lines
+463
to
468
| for (const [type, files] of filesByType.entries()) { | ||
| if (files.length === 0) { | ||
| continue; | ||
| } | ||
| result.push({ uri: base, type, files: files.sort(compareDiscoveredFile) }); | ||
| } |
Comment on lines
26
to
37
| /** | ||
| * Maps a {@link DiscoveredType} to the plugin sub-directory under which that | ||
| * component type lives in the Open Plugin format. | ||
| */ | ||
| function pluginDirForType(type: DiscoveredType): string | undefined { | ||
| switch (type) { | ||
| case DiscoveredType.Agent: return 'agents'; | ||
| case DiscoveredType.Skill: return 'skills'; | ||
| case DiscoveredType.Instruction: return 'rules'; | ||
| case DiscoveredType.Hook: return 'hooks'; | ||
| case DiscoveredType.AgentInstruction: return undefined; | ||
| } |
roblourens
approved these changes
Jun 19, 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.