Agent plugins: hooks, MCP servers and instructions work in the Local harness but not in the Copilot harness (SDK / Agent Host), Copilot CLI or Copilot Desktop
Summary
An Agent Plugin (OpenPlugin-style plugin.json that declares hooks, mcpServers and rules through paths + exclusive, with its content under a com.github.copilot/ folder) works end to end in the VS Code Local harness: hooks run, MCP servers start, instructions load. The same installed plugin does not behave the same in:
- VS Code Copilot harness (Copilot SDK / Agent Host)
- Copilot CLI
- GitHub Copilot Desktop / Agents window
Each surface seems to use its own plugin loader and its own hook format, so a plugin cannot be authored once and behave the same everywhere.
Environment
- VS Code 1.142.x, GitHub Copilot Chat extension, Windows 11
- Copilot CLI 1.0.x
- Plugin installed from a marketplace into
~/.copilot/installed-plugins/<marketplace>/<plugin>
Observed behavior
| Capability | VS Code Local | Copilot harness (SDK / Agent Host) | Copilot CLI | Desktop / Agents window |
|---|---|---|---|---|
| Hooks discovered | yes | yes (Customizations > Hook Discovery Results lists every file as loaded) | /hooks shows nothing from the plugin |
not verified |
| Hooks executed | yes | no | no | not verified |
| Plugin MCP servers | yes | not started automatically | not verified | not shown |
| Plugin instructions / rules | yes | not loaded | n/a | not verified |
Custom hook path (hooks.paths, exclusive) |
honored | unclear | appears ignored | unclear |
Likely causes (partly from reading existing issues, not all verified)
- Different hook schemas. The Copilot harness appears to honor only Copilot-style entries (
bash/powershell) and ignore VS Code-style entries (commandwithwindows/linux/osx). See #342664. - Non-standard plugin layout. The Copilot CLI documents plugin hooks as
hooks.jsonorhooks/hooks.jsoninside the installed plugin directory. A hooks file reached only throughplugin.jsonhooks.paths(for example undercom.github.copilot/) is not found, so/hooksstays empty. See #334153 for the samecom.github.copilotlayout problem. - Discovery is not execution. The harness reports a hook file as loaded, but nothing runs. There is no log or UI signal explaining why. See #302865, #302350 and #342022.
- Plugin MCP servers and agents. Plugin-owned MCP servers are not auto-started in Agent Host (#342860); custom agents are not picked up (#342085);
${PLUGIN_ROOT}is not expanded for canonical schema plugins (#335006). - Plugin source mismatch. The Copilot harness only reads installs under
~/.copilot/installed-plugins(#342671), and plugin sync can fail on some setups (#341862). - Instructions. How instructions and
applyTorules are loaded in the Copilot harness is unclear (#342595).
Expected behavior
A plugin that installs correctly should expose the same hooks, MCP servers, instructions and agents in every client, or the docs should state exactly which manifest fields and hook formats each client supports.
Requests
- Document, per client (Local, Copilot harness / Agent Host, Copilot CLI, Desktop), which
plugin.jsonfields are honored:hooks,mcpServers,rules,paths,exclusive, and thecom.github.copilot/folder convention. - Accept both hook entry formats (
commandplus per-OS overrides, andbash/powershell) in every client, or log a clear warning when an entry is skipped. - When a hook is discovered but cannot run, surface the reason in the Hook Discovery Results view and in the output channel.
- Make Copilot CLI
/hookslist hooks contributed by installed plugins, including those declared throughplugin.json. - Provide a single supported way to declare plugin MCP servers and instructions that all clients load.
Related issues
microsoft/vscode: #342664, #342022, #302865, #302350, #334153, #342860, #342085, #335006, #342671, #342595, #341862 github/copilot-cli: #4629, #4520
Additional isolated reproduction for file-scoped plugin MDC instructions on VS Code 1.144.0 (Windows x64, commit 2c33b50b16c472efe58357d1d2a8a5414bc23fbf).
Tested with the exact bundled SDK 1.0.27-unstable.40031404408.gba6c003 and runtime 1.0.103-unstable.r40031404408.gba6c003, using a synthetic plugin and a localhost-only model stub. No external model request or private plugin content is involved.
The plugin contains com.github.copilot/rules/scoped.mdc:
---
alwaysApply: true
globs: ["**/*.probe"]
---
HARNESS_GATED_2509
A native view tool call reads matching.probe; the stub captures marker presence in the actual follow-up model request.
| Session configuration | Scoped rule after matching view | Scoped rule after nonmatching view | Plugin skill invocation |
|---|---|---|---|
enableOnDemandInstructionDiscovery omitted |
Absent | Absent | Succeeds |
enableOnDemandInstructionDiscovery: true |
Present | Absent | Succeeds |
Both configurations enable enableConfigDiscovery, enableSkills and enableFileHooks. The global plugin rule is present in both. Twelve asserted cases cover initial prompts, matching/nonmatching views, source-disable-list clearing and actual skill invocation. Clearing disabledInstructionSources alone does not activate scoped discovery.
Static inspection of the shipped Agent Host _buildSessionConfig shows discovery, skills and file hooks enabled, but no explicit enableOnDemandInstructionDiscovery. The bundled SDK forwards this option without enabling it by default in copilot-cli mode. The additional session-configuration spreads inspected do not enable it either.
In a fresh actual VS Code Copilot session after updating, the plugin skill now loads successfully, but the agent reports no scoped instruction after a matching file read. This live-session observation is a context self-report, not a raw prompt capture.
Could maintainers check whether normal Copilot Agent Host sessions should enable on-demand instruction discovery and ensure it also triggers for client-bridged file tools? The isolated test uses native view; the live Agent Host may bridge file tools differently. The evidence narrows the issue but does not capture effective options of that live session.
This finding concerns scoped instructions specifically; it does not establish a common cause for the hooks or MCP symptoms in this issue.
Can you provide the sample plugin that demonstrates the problems?
@aeschli You can use this demo plugin that contains some instructions/rules, otherwise there are some examples in these two related issues :
- https://github.com/github/copilot-cli/issues/5440
- #347955
This issue has been closed as it has been labeled with info-needed and has not received the additional information that was requested from the issue author. It has been labeled as info-needed for 7 days.
@aeschi why is this closed as info needed? Info was provided. And this is still not working correctly in 147. Can you guys PLEASE FOR THE LOVE OF GOD TEST PROPERLY? It's EXTREMELY tiresome. EVERY DAMN VSCODE RELEASE MSFT changes the plugins layout. STANDARDISE INTERNALLY HOW THE MSFT EXTENSION OF THE PLUGINS ARCHITECTURE SHOULD WORK. PLEASE.
I have a list of upstream issues related to plugins and scoped instructions not applying as long as my arm. Copilot CLI and vscode are a completely unusable mess and if I weren't stuck with it as the only game in town for powershell sandboxing I'd by now have thrown it out.
Please don't take it personally but what you guys ship at the moment is a steaming pile of slop.