microsoft / microsoft/vscode

Agent plugins: reconcile partial storage and source migrations

Open
#331,532 0 comments 0 reactions 1 assignee Claimed by @connor4312 View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

Does this issue occur when all extensions are disabled?: Yes (the failing paths are in the core agent-plugin services)

- VS Code Version: 1.133.0; also present on `main` at dd4574812393057fee4e9a3acd5688ab37902357
- OS Version: macOS 26.5.2 (arm64)

Agent plugin state can remain partially migrated in two related cases.

### 1. Both storage roots exist

Steps to Reproduce:

1. Leave plugin repositories under the legacy `cacheHome/agentPlugins` root.
2. Create the current `agentPluginsHome` root too, as can happen when an earlier migration or install populated only part of the destination.
3. Start VS Code.

Actual: `AgentPluginRepositoryService._migrateDirectory()` logs that both directories exist and returns. It also leaves the marketplace index untouched, so the warning and stale repository URIs recur on every startup.

Expected: reconcile the cache roots without combining two git worktrees, make the current root authoritative, remove the legacy root, and invalidate the stale marketplace index.

### 2. An installed marketplace plugin changes source

Steps to Reproduce:

1. Install a relative-path plugin from a marketplace.
2. Change that marketplace entry to an independent GitHub source, preserving the marketplace/plugin identity. A current real-world example is `advanced-security`, which moved from `github/copilot-plugins/plugins/advanced-security` to `github/copilot-advanced-security-plugin`.
3. Run automatic Update All or click Update.

Actual: Update All skips installed relative-path entries before comparing their live descriptor, while the manual path tries to update a repository that has not been cloned and retains the old installed URI. The persisted entry then points to a removed path.

Expected: provision the live source first, atomically replace the installed registry URI and metadata, then clean up the old source if no installed plugin still uses it.

In one affected profile these two paths left three unresolved entries (one missing repository, one retired plugin, and one source-moved plugin) plus the recurring dual-root warning. Reconciliation restored every registered URI and remained clean across two cold starts.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.