Skip to content

Plugin marketplace cache ignores  ref  when shared across projects with different branches #4513

Description

@kristenmatsumoto

Describe the bug

When two projects reference the same git-based marketplace source but pin different  ref  values (branches) in  .github/copilot/settings.json 's  extraKnownMarketplaces , Copilot CLI reuses a single on-disk cache checkout keyed only by the source URL/path — not by  ref . Opening a project that expects  branch1  does not re-checkout the cache to  branch1  if it was last left on  branch2  by another project.

Affected version

Copilot CLI 1.0.80

Steps to reproduce the behavior

  1. Create marketplace repo with  branch1  and  branch2 , differing plugin content.
  2. Project A's  .github/copilot/settings.json  sets  extraKnownMarketplaces..source.ref = "branch2" . Open Copilot CLI there — cache clones/checks out  branch2 .
  3. Project B (different repo) sets  ref = "branch1"  for the same marketplace source URL. Open Copilot CLI there.
  4. Expected: cache checks out  branch1  before loading plugins for Project B.
  5. Actual: cache in  %LOCALAPPDATA%\copilot\marketplaces<hash-of-source>  remains on  branch2 ; Project B silently loads branch2's plugins instead of branch1's.

Expected behavior

When a project's  .github/copilot/settings.json  specifies a  ref  (branch/tag/commit) for an  extraKnownMarketplaces  entry, Copilot CLI should ensure the local cache reflects that exact  ref  before loading plugins for that session — regardless of what  ref  was last checked out there by a different project sharing the same source URL.

Additional context

Suggested fix (from copilot lol): Include  ref  in the cache key/path, or verify+checkout the requested  ref  on every load regardless of cache state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:pluginsPlugin system, marketplace, hooks, skills, extensions, and custom agents

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions