Plugin marketplace cache ignores ref when shared across projects with different branches
还没有人认领这个 Issue。
- 主要语言
- Shell
- 星标
- 11.2k
- 派生
- 1.9k
- 平均合并
- 14 小时 16 分钟
- 30 天内合并 PR
- 6
描述
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
- Create marketplace repo with branch1 and branch2 , differing plugin content.
- Project A's .github/copilot/settings.json sets extraKnownMarketplaces..source.ref = "branch2" . Open Copilot CLI there — cache clones/checks out branch2 .
- Project B (different repo) sets ref = "branch1" for the same marketplace source URL. Open Copilot CLI there.
- Expected: cache checks out branch1 before loading plugins for Project B.
- 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.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
使用 .github/copilot/settings.json 重现两个项目的情况,将共享 git 源固定到 branch1 和 branch2,然后检查 %LOCALAPPDATA%\copilot\marketplaces<hash-of-source> 下的 checkout。完成标准是:无论之前哪个项目使用过缓存,每个项目都能从其请求的 ref 加载插件,并且为共享缓存场景提供回归覆盖。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- git, shell
- 领域
- cli, tooling
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 55/100