Skip to content

chat: Auto-install repository-configured plugins - #338945

Draft
Paul (pwang347) wants to merge 10 commits into
microsoft:mainfrom
pwang347:fix/336858-repository-plugin-activation
Draft

Paul (pwang347) wants to merge 10 commits into
microsoft:mainfrom
pwang347:fix/336858-repository-plugin-activation

Conversation

@pwang347

@pwang347 Paul (pwang347) commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Fixes #336858.

Summary

  • Read enabledPlugins and extraKnownMarketplaces from trusted .github/copilot/settings(.local).json and .claude/settings(.local).json files.
  • Match Copilot CLI repository precedence: Copilot local, Copilot shared, Claude local, then Claude shared.
  • Install enabledPlugins: true entries automatically with a disabled profile baseline, then activate them only for the repository.
  • Install and enable the plugin from the current repository's exact marketplace source, even when another repository has already installed the same plugin@marketplace identity.
  • Apply false as a repository-scoped disablement and preserve global state for absent entries.
  • Skip the redundant marketplace confirmation because workspace trust already authorizes the repository configuration.
  • Include repository-installed plugins in the existing automatic-update pipeline when user or managed settings authorize updates; repository autoUpdate cannot override global updates being off.
  • Forward repository enablement to Agent Host as a workspace-scoped customization decision without changing managed-policy behavior.
  • Keep settings keyed by their source folder in multi-root workspaces and publish only the primary session repository's overlay.
  • Reconcile installs and current marketplace metadata before the initial Agent Host customization snapshot is published.

Testing

  • npm run typecheck-client - passed.
  • Targeted ESLint over all changed TypeScript files - passed.
  • ./scripts/test.sh --run src/vs/workbench/contrib/chat/test/browser/plugins/workspaceAgentPluginActivation.test.ts --run src/vs/workbench/contrib/chat/test/common/plugins/workspacePluginSettingsService.test.ts --run src/vs/workbench/contrib/chat/test/browser/agentSessions/resolveCustomizationRefs.test.ts --run src/vs/workbench/contrib/chat/test/common/plugins/agentPluginEnablement.test.ts --run src/vs/workbench/contrib/chat/test/common/plugins/pluginMarketplaceService.test.ts --run src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostUntitledProvisionalSessionService.test.ts --run src/vs/workbench/contrib/mcp/test/common/pluginMcpDiscovery.test.ts - 236/236 tests passed after addressing review feedback.
  • ./scripts/test.sh --run src/vs/workbench/contrib/chat/test/browser/agentSessions/resolveCustomizationRefs.test.ts --run src/vs/workbench/contrib/chat/test/browser/plugins/workspaceAgentPluginActivation.test.ts --run src/vs/workbench/contrib/chat/test/browser/plugins/pluginInstallService.test.ts --run src/vs/workbench/contrib/chat/test/browser/plugins/pluginAutoUpdate.test.ts --run src/vs/workbench/contrib/chat/test/common/plugins/agentPluginEnablement.test.ts --run src/vs/workbench/contrib/chat/test/common/plugins/fileBackedInstalledPluginsStore.test.ts --run src/vs/workbench/contrib/chat/test/common/plugins/pluginMarketplaceService.test.ts --run src/vs/workbench/contrib/chat/test/common/plugins/workspacePluginSettingsService.test.ts --run src/vs/workbench/contrib/mcp/test/common/pluginMcpDiscovery.test.ts - 260/260 tests passed.
  • ./scripts/test.sh --run src/vs/workbench/contrib/chat/test/common/plugins/pluginMarketplaceService.test.ts - 99/99 tests passed, including repository update-authorization regressions.
  • Simulated user-authorized update (v1 installed, marketplace changes to v2) - the automatic updater pulled and re-fetched only the targeted marketplace and reported it updated.
  • FFMPEG_PATH=/opt/homebrew/opt/ffmpeg-full/bin/ffmpeg FFPROBE_PATH=/opt/homebrew/opt/ffmpeg-full/bin/ffprobe node test/scenario/out/runScenario.js .build/vscode-playwright-mcp/repository-plugin-activation.cjs --dev - 3/3 steps passed on Code OSS Dev 1.141.0, macOS arm64.
  • FFMPEG_PATH=/opt/homebrew/opt/ffmpeg-full/bin/ffmpeg FFPROBE_PATH=/opt/homebrew/opt/ffmpeg-full/bin/ffprobe node test/scenario/out/runScenario.js .build/vscode-playwright-mcp/repository-plugin-auto-update-live.cjs --dev - 6/6 steps passed. The scenario installed v1 from an isolated Git remote, published v2, proved repository autoUpdate: true could not override global updates being off, then enabled only the user-global setting and observed git fetch -> behind check -> automatic git pull --ff-only plus v2 content on disk.
  • Manual actual-build validation on Code OSS Dev 1.141.0, macOS arm64 - passed. With reachable remote v2 and repository autoUpdate: true, the installed clone remained at v1 while global extensions.autoUpdate was "off". Changing only the global setting to "on" advanced the clone to v2 without opening Customizations, reloading, or invoking Refresh.

Deferred follow-ups

  • Align repository-local directory marketplaces with Copilot CLI's live, non-persistent loading model.

Evidence

Auto-install without confirmation

annotated.mp4

Repository plugin installed without confirmation

Automatic update trust boundary

annotated.mp4

Repository autoUpdate leaves v1 installed while global updates are off

User-authorized automatic update installs v2 content

Paul (pwang347) and others added 3 commits September 30, 2026 10:14
Honor trusted workspace enabledPlugins as workspace-scoped activation overlays and install missing configured plugins without enabling them globally.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Publish repository-scoped plugin decisions through activeClientSet so Copilot, Claude, and Codex agent-host sessions resolve the same workspace overlay as local chat.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Multi-root scoping, restart metadata preservation, and first-turn activation ordering remain incorrect.

Review effort: Balanced
Findings: 3 Medium severity

Open (3)
What changed in this PR

Aligns trusted repository plugin configuration with Copilot CLI behavior.

Changes:

  • Adds repository-scoped plugin enablement and Agent Host forwarding.
  • Automatically installs configured plugins and supports repository auto-update settings.
  • Replaces recommendation prompts with activation and adds coverage/documentation.
File Description
src/​vs/​workbench/​contrib/​mcp/​test/​common/​pluginMcpDiscovery.test.ts Updates plugin service mock.
src/​vs/​workbench/​contrib/​chat/​test/​common/​plugins/​workspacePluginSettingsService.test.ts Tests trust gating and marketplace parsing.
src/​vs/​workbench/​contrib/​chat/​test/​common/​plugins/​pluginMarketplaceService.test.ts Tests repository auto-update behavior.
src/​vs/​workbench/​contrib/​chat/​test/​common/​plugins/​fileBackedInstalledPluginsStore.test.ts Tests inventory readiness.
src/​vs/​workbench/​contrib/​chat/​test/​common/​plugins/​agentPluginEnablement.test.ts Tests workspace overlays and policy precedence.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​plugins/​workspaceAgentPluginActivation.test.ts Tests automatic installation behavior.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​plugins/​pluginInstallService.test.ts Tests trust-prompt bypass.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​resolveCustomizationRefs.test.ts Tests Agent Host workspace enablement.
src/​vs/​workbench/​contrib/​chat/​common/​plugins/​workspacePluginSettingsService.ts Trust-gates repository plugin settings.
src/​vs/​workbench/​contrib/​chat/​common/​plugins/​pluginMarketplaceService.ts Exposes inventory readiness and update settings.
src/​vs/​workbench/​contrib/​chat/​common/​plugins/​pluginInstallService.ts Adds trust-bypass install options.
src/​vs/​workbench/​contrib/​chat/​common/​plugins/​fileBackedInstalledPluginsStore.ts Exposes initialization completion.
src/​vs/​workbench/​contrib/​chat/​common/​plugins/​AGENTS_PLUGINS.md Documents repository activation.
src/​vs/​workbench/​contrib/​chat/​common/​plugins/​agentPluginServiceImpl.ts Applies configured enablement overlays.
src/​vs/​workbench/​contrib/​chat/​common/​plugins/​agentPluginService.ts Exposes workspace enablement decisions.
src/​vs/​workbench/​contrib/​chat/​common/​plugins/​agentPluginEnablement.ts Combines policy and workspace states.
src/​vs/​workbench/​contrib/​chat/​browser/​workspaceAgentPluginActivation.ts Implements automatic repository installation.
src/​vs/​workbench/​contrib/​chat/​browser/​pluginInstallService.ts Supports trusted configuration installs.
src/​vs/​workbench/​contrib/​chat/​browser/​claudePluginRecommendations.ts Removes the recommendation prompt.
src/​vs/​workbench/​contrib/​chat/​browser/​chat.shared.contribution.ts Registers automatic activation.
src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentHost/​agentHostLocalCustomizations.ts Publishes workspace-scoped decisions.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/vs/workbench/contrib/chat/browser/chat.shared.contribution.ts
Comment thread src/vs/workbench/contrib/chat/browser/workspaceAgentPluginActivation.ts Outdated
Comment thread src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.ts Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Paul (pwang347) and others added 4 commits September 30, 2026 11:27
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolve automatic-update eligibility from the current trusted repository marketplace configuration rather than the value captured when the plugin was installed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Match Copilot CLI repository-settings precedence and apply workspace enablement only to the plugin from the current repository marketplace source.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep repository-scoped install and activation while requiring user or managed settings to authorize silent updates to the shared plugin cache.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Paul (pwang347) and others added 2 commits October 1, 2026 12:58
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

Align repository enabledPlugins behavior with Copilot CLI

2 participants