Repository navigation
chat: expose PLUGIN_ROOT to local plugin hooks - #338967
Merged
Merged
Conversation
Co-authored-by: Copilot <[email protected]>
Contributor
Screenshot ChangesBase: Changed (2)2 insignificant change(s) omitted (≤20 px, Δ≤2). See CI logs for details. |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Plugin paths containing shell metacharacters can be corrupted or evaluated during command interpolation.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Exposes PLUGIN_ROOT to Copilot and Agent Plugins v1 hooks in the Local chat harness.
Changes:
- Adds plugin-root interpolation and environment variables.
- Covers plugin-level and custom-agent hooks.
- Updates tests and plugin documentation.
| File | Description |
|---|---|
pluginParsers.ts |
Enables root interpolation for two plugin formats. |
pluginParsers.test.ts |
Tests Agent Plugin hook expansion. |
agentPluginFormatDetection.test.ts |
Tests Copilot plugin discovery behavior. |
promptsService.test.ts |
Tests custom-agent hook expansion. |
AGENTS_PLUGINS.md |
Documents format behavior. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot <[email protected]>
Paul (pwang347)
marked this pull request as ready for review
September 30, 2026 20:23
Paul (pwang347)
enabled auto-merge (squash)
September 30, 2026 20:23
Co-authored-by: Copilot <[email protected]>
Dmitriy Vasyura (dmitrivMS)
approved these changes
Sep 30, 2026
Ashok Raj (ashokraj2011)
added a commit
to ashokraj2011/singularityflow
that referenced
this pull request
Nov 9, 2026
… as VS Code before 1.141 does VS Code passes PLUGIN_ROOT to a plugin's hooks only from 1.141 (microsoft/vscode#338967). An office laptop on 1.126 refused every tool call with SFLOW_HOOK_PLUGIN_ROOT_UNAVAILABLE, and reload or reinstall could not help. With no usable PLUGIN_ROOT or COPILOT_PLUGIN_ROOT, the hooks now read the folder recorded beside SFlow's Copilot mode file, which plugin install writes from Copilot's own record and the launcher keeps current. Only an absolute folder holding the launcher is used; otherwise the refusal now names the VS Code version. The closed-composer test allows exactly that one SFlow state path under the home folder and still forbids any other, listing and evaluation (owner decision). Co-Authored-By: Claude Opus 5.5 <[email protected]>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

Summary
PLUGIN_ROOTto Copilot-format and Agent Plugins v1 hooks collected by the Local chat harness${PLUGIN_ROOT}in hook commands using the contributing plugin directoryReproduction
An Agent Plugins v1
sessionStarthook contributed through a managed plugin runs on the Local harness, but its subprocess receives noPLUGIN_ROOT. The same plugin receivesPLUGIN_ROOTwhen the session uses Copilot Agent Host.This can surface when a session expected to use Copilot remains on Local: the hook itself functions, while scripts that resolve bundled resources through
PLUGIN_ROOTfail.Validation
npm run compile— passed with 0 errors./scripts/test.sh --run src/vs/platform/agentPlugins/test/common/pluginParsers.test.ts --run src/vs/workbench/contrib/chat/test/common/plugins/agentPluginFormatDetection.test.ts --run src/vs/workbench/contrib/chat/test/common/plugins/shellQuotePluginRootInCommand.test.ts --run src/vs/workbench/contrib/chat/test/common/promptSyntax/service/promptsService.test.ts— 240 passingnpm run eslint -- src/vs/platform/agentPlugins/common/pluginParsers.ts src/vs/platform/agentPlugins/test/common/pluginParsers.test.ts src/vs/workbench/contrib/chat/test/common/plugins/agentPluginFormatDetection.test.ts src/vs/workbench/contrib/chat/test/common/plugins/shellQuotePluginRootInCommand.test.ts src/vs/workbench/contrib/chat/test/common/promptSyntax/service/promptsService.test.ts— passedEvidence
Before
Before: the managed plugin hook runs, but
PLUGIN_ROOTis missing.plugin-root-before.mp4
After
After: the same hook receives the contributing Agent Plugins v1 directory as
PLUGIN_ROOT.plugin-root-after.mp4