github / github/copilot-cli

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

Đang mở
#4,513 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

area:plugins
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Tái hiện trường hợp hai project bằng .github/copilot/settings.json, với git source dùng chung được ghim vào branch1 và branch2, sau đó kiểm tra checkout trong %LOCALAPPDATA%\copilot\marketplaces<hash-of-source>. Hoàn tất khi mỗi project tải plugin từ ref mà nó yêu cầu, bất kể trước đó project nào đã sử dụng cache, với coverage hồi quy cho scenario cache dùng chung.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
git, shell
Lĩnh vực
cli, tooling
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
55/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.