CommandCodeAI / CommandCodeAI/command-code
bug: skills add fails with EPERM on macOS 26 -- giget cache in shared ~/.cache collides with app-data protection
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 4k
- Fork
- 350
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Problem
cmd skills add downloads repos via giget, which defaults its cache to the shared ~/.cache/giget. On macOS 26 (Tahoe), this breaks with a confusing error:
$ cmd skills add owner/repo/path --global -f
✘ Failed to fetch "owner/repo": EPERM: operation not permitted, mkdir '/Users/callsen/.cache/giget'
Root cause: macOS Tahoe stamps directories with a com.apple.provenance xattr identifying the creating app, and denies access to processes attributed to other apps -- reportedly even when the app has Full Disk Access (see Apple Community discussion on 26.4 third-party app stamps: https://discussions.apple.com/thread/256294444). ~/.cache is shared by many CLIs across many host apps (terminal emulators, IDEs, other agents), so whichever app first created ~/.cache/giget effectively owns it. Run cmd from a different terminal app and the mkdir/stat gets EPERM. The kernel returns EPERM rather than EEXIST, so the error misleadingly suggests a local permissions problem.
Observed on v1.5.0, macOS 26 (Darwin 25.3), where ~/.cache contained a dozen subdirs unreadable by the invoking terminal (giget, codex-runtimes, huggingface, starship, ...), all created by tools running under other host apps.
Workaround (confirmed working)
giget honors XDG_CACHE_HOME:
XDG_CACHE_HOME="$HOME/.commandcode/cache" cmd skills add owner/repo/path --global -f
This works because ~/.commandcode is created by cmd itself, so the invoking app owns its provenance stamp.
Proposal
- Point giget's download cache at a directory Command Code already owns --
~/.commandcode/cache/giget-- instead of the shared~/.cache/giget. SettingXDG_CACHE_HOMEfor the giget call (or using its cache-dir option if available) is sufficient. - Fix the related hardcoded path:
clearGigetCache()in the skills installer rm-rf's~/.cache/giget/gh/<owner>-<repo>unconditionally. If the cache moves (or a user setsXDG_CACHE_HOMEthemselves), the corrupted-archive recovery path clears the wrong directory and the retry loop can never self-heal. - Optionally: on EPERM from the cache path, surface a hint about macOS app-data protection rather than the raw errno, since the failure reads like a filesystem permissions bug and is not.
On macOS 26 this is a correctness issue, not a preference: any user who installs skills from a different terminal app than the one that first populated ~/.cache/giget hits a hard failure.
Related: #602 (skills update/provenance).
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
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 trong trình cài đặt skills tại clearGigetCache() và lần theo lời gọi tải xuống của giget để xem thư mục bộ nhớ đệm của nó được chọn như thế nào. Tái hiện lệnh cmd skills add đã được báo cáo, sau đó xác minh rằng các lượt tải xuống sử dụng ~/.commandcode/cache/giget và việc dọn dẹp các tệp lưu trữ bị hỏng nhắm đến cùng một vị trí, kể cả khi XDG_CACHE_HOME được đặt.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- macos
- 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
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 55/100