plugins: store installed plugins in storage rather than paths#298352
Merged
connor4312 merged 2 commits intomainfrom Feb 27, 2026
Merged
plugins: store installed plugins in storage rather than paths#298352connor4312 merged 2 commits intomainfrom
connor4312 merged 2 commits intomainfrom
Conversation
This simplifies some things and sets the groundwork for more special things (like updating and disk cleanup) that we'll do with marketplace plugins.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR shifts “installed marketplace plugins” tracking from chat.plugins.paths configuration to a storage-backed model, and wires that into plugin discovery so marketplace installs can be managed independently of user config.
Changes:
- Add storage-backed installed plugin tracking to
PluginMarketplaceService(observable list + add/remove/enable APIs) and make metadata lookup use that store. - Refactor agent plugin discovery into a shared base, and add a new discovery implementation for marketplace-installed plugins.
- Update install/uninstall flows and UI actions to register/remove plugins via the new installed-plugins storage rather than editing
chat.plugins.paths.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/test/common/plugins/pluginMarketplaceService.test.ts | Updates metadata lookup tests to use storage-backed installed plugins. |
| src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.ts | Introduces storage-backed installed plugin list + APIs; makes metadata lookup synchronous from storage. |
| src/vs/workbench/contrib/chat/common/plugins/pluginInstallService.ts | Updates install contract to register installs in storage; removes uninstall API. |
| src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.ts | Refactors discovery into an abstract base and adds marketplace-installed discovery. |
| src/vs/workbench/contrib/chat/common/plugins/agentPluginService.ts | Adds remove() to IAgentPlugin to support uninstall/removal from discovery source. |
| src/vs/workbench/contrib/chat/browser/pluginInstallService.ts | Installs now register in IPluginMarketplaceService instead of updating config paths. |
| src/vs/workbench/contrib/chat/browser/chat.contribution.ts | Registers the new MarketplaceAgentPluginDiscovery. |
| src/vs/workbench/contrib/chat/browser/agentPluginsView.ts | Uninstall action now calls plugin.remove() instead of going through IPluginInstallService. |
Comments suppressed due to low confidence (3)
src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.ts:129
installedPluginsMemento.fromStoragecurrently accepts any JSON array without validating element shape. If storage is corrupted (e.g. containsnull, a non-object, or a pluginUri without proper URI shape), later code can throw when accessingentry.pluginUrior callingtoString()inMarketplaceAgentPluginDiscovery. Consider validating each entry and reviving/normalizingpluginUri(e.g. viaURI.from(...)/URI.revive(...)) while dropping invalid entries to keep plugin discovery resilient to bad storage.
const installedPluginsMemento = observableMemento<readonly IStoredInstalledPlugin[]>({
defaultValue: [],
key: 'chat.plugins.installed.v1',
toStorage: value => JSON.stringify(value),
fromStorage: value => {
const parsed = JSON.parse(value);
return Array.isArray(parsed) ? parsed : [];
},
});
src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.ts:350
addInstalledPluginreturns early when an entry already exists forpluginUri, which prevents updating persisted metadata (description/version/readmeUri/etc.) for an already-installed plugin. This can leave the installed plugin list showing stale marketplace info. Consider updating the existing entry’spluginfield (while preserving its currentenabledstate) when the plugin is already present.
addInstalledPlugin(pluginUri: URI, plugin: IMarketplacePlugin): void {
const current = this.installedPlugins.get();
if (current.some(e => isEqual(e.pluginUri, pluginUri))) {
return;
}
this._installedPluginsStore.set([...current, { pluginUri, plugin, enabled: true }], undefined);
}
src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.ts:361
- New storage-backed installed plugin behavior (
installedPluginsobservable + add/remove/enable APIs) doesn’t appear to have unit coverage for persistence across service instances, enable/disable toggling, and removal behavior. Adding tests around these scenarios would help prevent regressions in the new storage contract.
setInstalledPluginEnabled(pluginUri: URI, enabled: boolean): void {
const current = this.installedPlugins.get();
this._installedPluginsStore.set(
current.map(e => isEqual(e.pluginUri, pluginUri) ? { ...e, enabled } : e),
undefined,
roblourens
approved these changes
Feb 27, 2026
DonJayamanne
pushed a commit
that referenced
this pull request
Mar 2, 2026
* plugins: store installed plugins in storage rather than paths This simplifies some things and sets the groundwork for more special things (like updating and disk cleanup) that we'll do with marketplace plugins. * fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This simplifies some things and sets the groundwork for more special things (like updating and disk cleanup) that we'll do with marketplace plugins.