Skip to content

chat: add support for agent plugin sources#299081

Open
connor4312 wants to merge 4 commits intomainfrom
connor4312/agent-plugins-sources
Open

chat: add support for agent plugin sources#299081
connor4312 wants to merge 4 commits intomainfrom
connor4312/agent-plugins-sources

Conversation

@connor4312
Copy link
Member

@connor4312 connor4312 commented Mar 3, 2026

  • Adds support for agent plugins to reference sources as specified in
    PLUGIN_SOURCES, 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)

- 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)
Copilot AI review requested due to automatic review settings March 3, 2026 23:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 + sourceDescriptor on 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.label for 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.md document, 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

  • _waitForTerminalCommandCompletion resolves undefined on timeout, but _runTerminalCommand treats any exitCode !== 0 as 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.

@connor4312 connor4312 marked this pull request as ready for review March 3, 2026 23:52
@vs-code-engineering
Copy link

vs-code-engineering bot commented Mar 3, 2026

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@lszomoru

Matched files:

  • extensions/git/src/commands.ts
  • extensions/git/src/git.ts

1 similar comment
@vs-code-engineering
Copy link

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@lszomoru

Matched files:

  • extensions/git/src/commands.ts
  • extensions/git/src/git.ts

@vs-code-engineering vs-code-engineering bot added this to the 1.111.0 milestone Mar 3, 2026
joshspicer
joshspicer previously approved these changes Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants