Copilot plugin agents disappear after AgentPluginManager evicts stale nonce
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
## Type of issue
Bug
## VS Code version
```text
Version: 1.136.0-insider
Commit: d5ceefbe0b296c4d8fbbf3664aff8cad73cd1b5d
Architecture: x64
OS: Windows
```
## Summary
Custom agents contributed by an installed Copilot CLI plugin intermittently disappear from the custom-agent picker. The plugin remains installed and enabled, and its manifest and agent files are valid, but `AgentPluginManager` repeatedly synchronizes the plugin and then evicts its nonce as stale.
This was observed with the `hve-core@hve-core` plugin (v3.2.2), installed through `copilot plugin install`. The manifest declares 54 agents and all 54 referenced files exist.
## Steps to reproduce
1. Install the plugin:
```powershell
copilot plugin install hve-core@hve-core
```
2. Open VS Code Insiders on Windows. Multiple Insiders windows were open when the problem was first observed.
3. Open Chat and inspect the custom-agent picker.
4. The contributed agents may appear briefly or in some windows, then disappear.
5. Reinstall the plugin and reload the Insiders windows.
## Actual behavior
The plugin registration is synchronized into the Insiders `agentPlugins` cache, but is subsequently evicted. Reinstalling does not make the registration stable.
Representative sanitized Agent Host events:
```text
[info] [AgentPluginManager] Syncing plugin: file:///c%3A/Users//.copilot/installed-plugins/hve-core/hve-core -> .../agentPlugins/.../
[error] [AgentPluginManager] Failed to sync plugin ...: Unable to resolve nonexistent file 'vscode-agent-client:///file/-/c:/Users//.copilot/installed-plugins/hve-core/hve-core/evals'
[error] [AgentPluginManager] Failed to sync plugin ...: Unable to resolve nonexistent file 'vscode-agent-client:///file/-/c:/Users//.copilot/installed-plugins/hve-core/hve-core'
[info] [AgentPluginManager] Syncing plugin: ...
[info] [AgentPluginManager] Evicting stale nonce for plugin: file:///c%3A/Users//.copilot/installed-plugins/hve-core/hve-core
```
In one controlled retry, eviction occurred about 34 seconds after synchronization, followed by another sync and another eviction about 10 seconds later.
`copilot plugin list` continues to report:
```text
hve-core@hve-core (v3.2.2)
```
The final synchronized cache generation also contains `plugin.json` and all declared agent files, so this does not appear to be a missing or malformed plugin payload.
## Expected behavior
An enabled plugin with a valid manifest should remain registered, and its contributed agents should remain available consistently across Chat windows.
## Additional context
A normal `Developer: Reload Window` reused the shared Agent Host and did not stabilize the registration. This may be related to client reconnection or synchronization when multiple Insiders windows share the Agent Host.
Possibly related, but different failure mode: #322066.
Contributor guide
Assessment
This issue has not been assessed yet.