Repository navigation
Recognize userPromptTransformed plugin hooks in Copilot sessions - #345068
Merged
Connor Peet (connor4312) merged 1 commit intoOct 30, 2026
Merged
Connor Peet (connor4312) merged 1 commit into
Connor Peet (connor4312) merged 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the hook-discovery and prompt-transformation changes, though interactive Copilot validation remains outstanding.
No open issues 🎉
What changed in this PR
Fixes discovery and forwarding of Agent Plugins that contribute only userPromptTransformed, connecting platform parsing, workbench recognition, and Copilot SDK execution.
Changes:
- Recognizes the hook across shared types and parsers while keeping availability Copilot-specific.
- Adds sequential prompt transformations that preserve the original submitted prompt.
- Adds regression coverage for discovery, forwarding, replacement handling, failed commands, and isolation between messages.
Interactive Copilot validation remains outstanding, as noted in the PR description.
| File | Description |
|---|---|
src/vscode-dts/vscode.proposed.chatHooks.d.ts |
Adds the hook to the proposed API type. |
src/vs/workbench/contrib/chat/test/common/promptSyntax/hookCompatibility.test.ts |
Tests Copilot-specific recognition and aliases. |
src/vs/workbench/contrib/chat/test/common/plugins/agentPluginFormatDetection.test.ts |
Tests discovery of a transform-only plugin. |
src/vs/workbench/contrib/chat/test/browser/agentSessions/resolveCustomizationRefs.test.ts |
Tests forwarding without prompt-file contributions. |
src/vs/workbench/contrib/chat/common/promptSyntax/hookTypes.ts |
Registers the hook, metadata, and Copilot alias. |
src/vs/platform/agentPlugins/test/common/pluginParsers.test.ts |
Tests parsing a transform-only hook file. |
src/vs/platform/agentPlugins/common/pluginParsers.ts |
Recognizes canonical and Copilot hook names. |
src/vs/platform/agentHost/test/node/copilotPluginConverters.test.ts |
Tests transformation sequencing and output handling. |
src/vs/platform/agentHost/node/copilot/copilotPluginConverters.ts |
Adds the SDK adapter and chains transformed prompts. |
Review effort: Balanced
Connor Peet (connor4312)
approved these changes
Oct 30, 2026
Connor Peet (connor4312)
enabled auto-merge (squash)
October 30, 2026 15:50
Logan Ramos (lramos15)
approved these changes
Oct 30, 2026
Dirk Bäumer (dbaeumer)
approved these changes
Oct 30, 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.
Why
An Agent Plugin whose only contribution is a
userPromptTransformedhook appears enabled in VS Code, but never reaches Copilot. Adding an unrelatedsessionStarthook makes the same prompt-transform hook run.The platform parser drops the event, and the workbench also filters it out of the recognized hook types. With no recognized contributions left, VS Code skips forwarding the plugin to the agent host.
This recognizes
userPromptTransformedthrough both layers and adds its SDK adapter. Successive commands receive the previous command's transformed prompt and returnmodifiedTransformedPromptto Copilot. The original submitted prompt stays unchanged. Hook availability remains specific to Copilot.Testing
Regression tests cover discovery and forwarding of a plugin containing only this hook, prompt replacement, sequential transformations, empty replacements, failed commands, and isolation between messages. The affected Node and workbench suites pass (491 tests), along with client typechecking and targeted lint.
The original failure and the
sessionStartworkaround were reproduced in installed VS Code 1.144.0. The patched source has been validated through the build and tests above; it has not yet been exercised in an interactive Copilot session.To check in Copilot, install an Agent Plugin with only
com.github.copilot/hooks/hooks.jsoncontributinguserPromptTransformed. Have its command append a recognizable marker totransformedPromptand return it asmodifiedTransformedPrompt. Start a fresh Copilot session and verify the command runs and the model receives the marker without adding asessionStarthook or a skill.