Repository navigation
agentHost: keep plugin subagents in Copilot catalog - #342092
Martin Aeschlimann (aeschli) merged 3 commits into
Conversation
Project every enabled plugin agent into the SDK customAgents catalog so explicit built-ins do not suppress sibling discovery. Cover the handoff with unit tests and a bundled-runtime delegation integration test.\n\nFixes #341680 Co-authored-by: Copilot <[email protected]>
Document that the Copilot runtime suppresses discovery whenever customAgents is supplied, including an explicit empty array. Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Manual-only agents lose their invocation restriction, and the integration test does not select the synced plugin parent.
2 open findings
What changed in this PR
Restores plugin sibling agents to Copilot’s explicit agent catalog so they remain available for delegation.
Changes:
- Projects all plugin agents into
customAgents. - Preserves directory-based discovery for other plugin resources.
- Updates unit coverage and adds bundled-runtime sibling-delegation coverage.
| File | Description |
|---|---|
| src/vs/platform/agentHost/test/node/providerIntegration/copilotMockLlm.integrationTest.ts | Adds plugin sibling-delegation integration coverage. |
| src/vs/platform/agentHost/test/node/copilotPluginConverters.test.ts | Expects all plugin agents in the catalog. |
| src/vs/platform/agentHost/test/node/copilotAgent.test.ts | Verifies plugin agents alongside standalone and built-in agents. |
| src/vs/platform/agentHost/node/copilot/copilotSessionLauncher.ts | Uses the simplified catalog converter. |
| src/vs/platform/agentHost/node/copilot/copilotPluginConverters.ts | Includes every supplied plugin agent. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| } | ||
| } | ||
| return customAgents; | ||
| return toSdkCustomAgents(plugins.flatMap(plugin => plugin.agents), fileService); |
There was a problem hiding this comment.
Valid finding. Follow-up #342427 forwards the runtime disableModelInvocation flag and adds bundled-runtime coverage proving a restricted sibling cannot be delegated to.
| client.dispatch({ | ||
| channel: chatUri, | ||
| clientSeq: 2, | ||
| action: { | ||
| type: ActionType.ChatTurnStarted, | ||
| turnId: 'turn-plugin-subagent', | ||
| startedAt: new Date().toISOString(), | ||
| message: { | ||
| text: `[scenario:${PLUGIN_SIBLING_SCENARIO_ID}] Delegate to the plugin sibling.`, | ||
| origin: { kind: MessageKind.User }, | ||
| agent: { uri: URI.file(parentAgentFile).toString() }, |
There was a problem hiding this comment.
Valid finding. Follow-up #342427 selects the parent through the URI published on the synced plugin child, so the integration test now exercises the intended plugin parent.
Verify that a multi-agent plugin, workspace agents, and user-home agents remain in their distinct discovery containers. Co-authored-by: Copilot <[email protected]>
7b634c7
into
microsoft:main
Forward model-invocation restrictions into the Copilot runtime catalog and exercise delegation using the synced plugin agent URI.\n\nFollow-up to #342092. Co-authored-by: Copilot <[email protected]>

Fixes #341680
The Copilot runtime treats any explicitly provided
customAgentsarray, including an empty one, as the complete agent catalog instead of merging agents discovered frompluginDirectories. Because Agent Host always supplies its built-in agents explicitly, file-plugin siblings disappeared from thetasktool whenever a plugin parent was selected.This change projects every enabled plugin agent into
customAgentswhile continuing to usepluginDirectoriesfor the plugin's other resources. It adds discovery coverage for a multi-agent plugin alongside workspace and user-home agents, plus a real bundled-runtime integration test that selects a plugin parent and successfully delegates throughtaskto a sibling from the same plugin.Validation
npm run build-fast -- --client-only./scripts/test.sh --run src/vs/platform/agentHost/test/node/copilotPluginConverters.test.ts --run src/vs/platform/agentHost/test/node/copilotAgent.test.ts --grep 'toSdkSessionCustomAgents|passes a standalone client bundle'(3 tests)./scripts/test.sh --run src/vs/platform/agentHost/test/node/copilotPluginConverters.test.ts --run src/vs/platform/agentHost/test/node/copilotSessionLauncher.test.ts(182 tests)./scripts/test.sh --run src/vs/platform/agentHost/test/node/sessionCustomizationDiscovery.test.ts(17 tests)./scripts/test-integration.sh --run src/vs/platform/agentHost/test/node/providerIntegration/copilotMockLlm.integrationTest.ts --grep 'selected plugin agent delegates'npm run typecheck-client