microsoft / microsoft/vscode

Native MDM ignores documented object-form plugin marketplaces

Open Beginner friendly
#333,816 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

## Environment

- VS Code: Code - OSS 1.137.0
- Copilot Chat: built-in 0.65.0
- OS: macOS
- Feature: enterprise-managed agent plugin marketplaces

## Steps to Reproduce

1. Deliver `extraKnownMarketplaces` through macOS native MDM as a string containing the documented object-form value:

```xml
extraKnownMarketplaces
{"enterprise-marketplace":{"source":{"source":"git","url":"https://dev.azure.com/example/project/_git/plugins"},"autoUpdate":true}}
```

Replace the example URL with an accessible plugin marketplace repository.

2. Start VS Code with a clean user profile.
3. Run `Developer: Policy Diagnostics` and confirm that `chat.plugins.extraMarketplaces` contains the object above.
4. Open Extensions and search for `@agentPlugins`.

## Expected

Plugins from the managed marketplace appear, and VS Code fetches the marketplace repository.

## Actual

No managed plugins appear, and VS Code never fetches the marketplace repository. Adding the same URL to the user `chat.plugins.marketplaces` setting makes the plugins appear.

## Evidence and Root Cause

- [GitHub defines `extraKnownMarketplaces` entries as named objects containing `source` and optional `autoUpdate`](https://docs.github.com/en/copilot/reference/enterprise-administrators/enterprise-managed-settings#extraknownmarketplaces).
- [GitHub's native-MDM instructions say MDM uses the same logical keys and values as server-managed settings, with objects stored as JSON text in string values](https://docs.github.com/en/copilot/how-tos/administer-copilot/manage-for-enterprise/manage-agents/configure-enterprise-managed-settings#deploying-mdm-managed-settings).
- [VS Code documents that all three managed-settings channels use the same keys and values, and that one definition governs VS Code and Copilot CLI](https://code.visualstudio.com/docs/enterprise/ai-settings#_deploy-copilot-managed-settings).

VS Code's policy configuration [parses a structured string policy value as JSON](https://github.com/microsoft/vscode/blob/35e20f9dcd9a5c16f9cda64be1a1db0788922d69/src/vs/platform/configuration/common/configurations.ts#L242-L258). The resulting object reaches `readConfiguredMarketplaces()`, which [drops every non-string marketplace value](https://github.com/microsoft/vscode/blob/35e20f9dcd9a5c16f9cda64be1a1db0788922d69/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.ts#L52-L70). This happens even though the next parsing stage [already dispatches object values to `parseMarketplaceObjectEntry()`](https://github.com/microsoft/vscode/blob/35e20f9dcd9a5c16f9cda64be1a1db0788922d69/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.ts#L93-L102), which [supports nested `git` sources, marketplace names, and `autoUpdate`](https://github.com/microsoft/vscode/blob/35e20f9dcd9a5c16f9cda64be1a1db0788922d69/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.ts#L134-L166).

## Local Validation

A clean-profile A/B on Code OSS 1.137.0 at [`c9479ade`](https://github.com/microsoft/vscode/commit/c9479adea70489f96371e8db8576f0c40054f895) produced:

- Unpatched: `@agentPlugins` showed no managed plugins.
- Patched: the managed plugin appeared, installed successfully, and its skill loaded in Copilot Chat.

After rebasing the fix onto [`35e20f9d`](https://github.com/microsoft/vscode/commit/35e20f9dcd9a5c16f9cda64be1a1db0788922d69):

- `npm run compile-client`: completed with zero errors.
- `./scripts/test.sh --run src/vs/workbench/contrib/chat/test/common/plugins/pluginMarketplaceService.test.ts`: 92 passing.
- Targeted ESLint on both changed files: passed.

Contributor guide

Open the contributing guide

Research direction

Start in src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.ts, especially readConfiguredMarketplaces() and parseMarketplaceObjectEntry(). Run src/vs/workbench/contrib/chat/test/common/plugins/pluginMarketplaceService.test.ts first, then add coverage for object-form values arriving through policy configuration. Done means the documented native-MDM marketplace object is retained and its managed plugin can be discovered.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.