chat: add support for agent plugin sources#299081
Conversation
- Adds support for agent plugins to reference sources as specified in PLUGIN_SOURCES.md, enabling installation from GitHub, npm, pip, and other package registries - Integrates source parsing and validation into the plugin installation service and repository service - Adds comprehensive test coverage for plugin source handling and installation from various sources - Creates PLUGIN_SOURCES.md documentation describing how to specify plugin source configurations (Commit message generated by Copilot)
There was a problem hiding this comment.
Pull request overview
Adds first-class support for installing Agent Plugins from multiple “source” types (relative path in a marketplace repo, GitHub/git URL, npm, pip), including parsing/validation of marketplace.json source and wiring install/update flows through repository + install services.
Changes:
- Introduces
PluginSourceKind+sourceDescriptoron marketplace plugins and parsing/label helpers (parsePluginSource,getPluginSourceLabel). - Extends repository/install services to clone/update git sources and run npm/pip installs via the terminal.
- Updates UI + discovery plumbing to use a new
IAgentPlugin.labelfor display, and adds/updates tests accordingly.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/mcp/common/discovery/pluginMcpDiscovery.ts | Uses plugin-provided label for MCP collection display name. |
| src/vs/workbench/contrib/chat/test/common/promptSyntax/service/promptsService.test.ts | Updates test plugin objects to include label. |
| src/vs/workbench/contrib/chat/test/common/plugins/pluginMarketplaceService.test.ts | Adds unit tests for plugin source parsing/label formatting. |
| src/vs/workbench/contrib/chat/test/browser/plugins/pluginInstallService.test.ts | New tests covering install/update behavior for multiple source kinds. |
| src/vs/workbench/contrib/chat/test/browser/plugins/agentPluginRepositoryService.test.ts | Extends repo service tests for revision-aware git source URIs + updates. |
| src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.ts | Adds sourceDescriptor model, parsing/validation, labels, and storage migration. |
| src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.ts | Populates IAgentPlugin.label during discovery. |
| src/vs/workbench/contrib/chat/common/plugins/agentPluginService.ts | Adds label to IAgentPlugin. |
| src/vs/workbench/contrib/chat/common/plugins/agentPluginRepositoryService.ts | Extends repository service interface for non-repo plugin sources. |
| src/vs/workbench/contrib/chat/browser/pluginInstallService.ts | Implements install/update flows for git/npm/pip sources via repo service + terminal. |
| src/vs/workbench/contrib/chat/browser/agentPluginsView.ts | Threads sourceDescriptor through UI items and uses plugin label for display. |
| src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.ts | Implements cache paths + clone/update/checkout for git sources; cache URIs for npm/pip. |
| src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginItems.ts | Adds sourceDescriptor to marketplace plugin item shape. |
| src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.ts | Uses plugin label for installed items and threads sourceDescriptor. |
| extensions/git/src/git.ts | Adds clone targetName support to clone into an exact folder name. |
| extensions/git/src/commands.ts | Changes _git.cloneRepository to take a localPath and adds _git.checkout command. |
Comments suppressed due to low confidence (2)
src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.ts:705
- PR description mentions adding a
PLUGIN_SOURCES.mddocument, but it doesn’t appear to be included in this change set (no file found in the repo). Either add the documentation file as described, or update the PR description to match what’s actually being shipped.
* Parse a raw `source` field from marketplace.json into a structured
* {@link IPluginSourceDescriptor}. Accepts either a relative-path string
* or a JSON object with a `source` discriminant indicating the kind.
*/
export function parsePluginSource(
src/vs/workbench/contrib/chat/browser/pluginInstallService.ts:295
_waitForTerminalCommandCompletionresolvesundefinedon timeout, but_runTerminalCommandtreats anyexitCode !== 0as failure, so a timeout results in an error like “Command exited with code undefined”. Handle the timeout case explicitly (eg show a dedicated timeout error and/or return failure before formatting the exit code message).
const timeoutHandle: CancelablePromise<void> = timeout(120_000);
disposables.add(toDisposable(() => timeoutHandle.cancel()));
void timeoutHandle.then(() => {
if (isResolved) {
return;
}
this._logService.warn('[PluginInstallService] Terminal command completion timed out');
resolveAndDispose(undefined);
});
});
You can also share your feedback on Copilot code review. Take the survey.
src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.ts
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/test/browser/plugins/agentPluginRepositoryService.test.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/chat/test/browser/plugins/pluginInstallService.test.ts
Outdated
Show resolved
Hide resolved
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @lszomoruMatched files:
|
1 similar comment
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @lszomoruMatched files:
|
PLUGIN_SOURCES, enabling installation from GitHub, npm, pip, and
other package registries
service and repository service
installation from various sources
plugin source configurations
(Commit message generated by Copilot)