Adding agentic marketplace fails when marketplace repo has files with long paths
Chưa có ai nhận issue này.
- 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
So, i have seen a couple of times where someone tries to add an agentic marketplace via "/plugin marketplace add" and fails with obscure error, because the marketplace repo happens to have a file path long enough where, together with the location CLI chooses to clone the repo locally, exceeds the default 260 char max limit in windows.
Example error from CLI when this happens (a couple of specific paths obscured for privacy):
`/plugin marketplace add https://dev.azure.com/microsoft/OS.Developer/_git/NAME_OF_REPO_PROJECT_HERE
Failed to add marketplace: Request plugins.marketplaces.add failed with message: Failed to fetch git marketplace from the provided URL. Please verify that the URL and reference are correct. Details: Command failed: git clone --depth 1 --progress https://dev.azure.com/microsoft/OS.ZZZZZZZZZZZ/_git/NAME_OF_REPO_PROJECT_HERE C:\Users\USER_NAME_HERE\AppData\Local\copilot\marketplaces\https---dev-azure-com-XXXXXXXX-YY-ZZZZZZZZZZ--git-NAME_OF_REPO_PROJECT_HERE
Cloning into 'C:\Users\USER_NAME_HERE\AppData\Local\copilot\marketplaces\https---dev-azure-com-XXXXXXX-YY-ZZZZZZZZZZZ--git-NAME_OF_REPO_PROJECT_HERE'...
remote: Azure Repos
remote: remote: Found 5359 objects to send. (148 ms)
(truncated)
Updating files: 100% (3956/3956), done.
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'
`
The above error is generally pretty obscure and end user has no idea why adding the marketplace fails.
- Can we detect this scenario and have better error message to explain to the user what happened? (And ideally help them resolve it by turning off windows path limit or something.)
- Can we internally clone the repo to a shorter path so that this is less likely to trip? E.g. hash the repo URI or something, instead of having the entire repro URI as part of the path. The existing install path by default is like 100 char long and uses up half the char length already.
Affected version
GitHub Copilot CLI 1.0.81-1
Steps to reproduce the behavior
- Find a agentic marketplace with some long-ish path inside. (Contact cchui@microsoft.com offline if you need examples.)
- Run /plugin marketplace add INSERT_MARKETPLACE_URI_HERE
- Encounter error desscribed above in the bug description
Expected behavior
Ideally succeed, or at least a helpful error so the user understands what went wrong / how to resolve it (e.g. turn off max path limit.)
Additional context
No response
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với phần triển khai đằng sau /plugin marketplace add và việc xây dựng đường dẫn git clone, sau đó tái hiện lỗi checkout trên Windows bằng một marketplace có các đường dẫn dài. Công việc được xem là hoàn tất khi marketplace thành công với vị trí clone ngắn hơn hoặc báo cáo một giải thích có thể hành động về lỗi do giới hạn đường dẫn của Windows.
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, operating-systems
- 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
- 58/100