skills-init: commit-SHA skill refs never start (git checkout -- <sha> reads the SHA as a pathspec)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 84/100
Hướng nghiên cứu
Đọc go/core/internal/skillsinit/git.go, tập trung vào CloneGit và đường dẫn checkout Full refs. Issue đưa ra một cách tái hiện tối thiểu chỉ dùng Git; hãy xác nhận các đối số checkout được truyền như thế nào, sau đó kiểm tra các bài kiểm thử gần đó cho hành vi này. Hoàn tất khi các ref SHA của commit được checkout thành công trên dòng 0.10 và các ref branch, tag vẫn hoạt động.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happens
An agent whose skills pin a commit SHA never leaves Init. skills-init fails with:
error: pathspec '<sha>' did not match any file(s) known to git
skills-init: clone <url>: exit status 1
Agents that pin a branch or tag are fine.
Why
CloneGit in go/core/internal/skillsinit/git.go takes the Full path for a commit SHA and runs:
if err := runGitIn(ref.Dest, "checkout", "--", ref.Ref); err != nil {
With the -- separator, git treats everything after it as a pathspec, not a revision. So the SHA is looked up as a file name and the checkout fails. The commit is present in the clone; only the argument parsing is wrong.
The comment above the call says the separator is there so "a ref starting with -" cannot be parsed as a flag, and notes that refs are already validated as 40-char hex when Full is true. That validation is real — the controller sets Full from isCommitSHA, which is ^[0-9a-fA-F]{40}$ — so a 40-character hex string can never be an option and the separator protects nothing.
Minimal reproduction
No kagent needed; this is plain git:
git clone https://github.com/<any>/<repo>.git /tmp/r
cd /tmp/r
git checkout -- "$(git rev-parse HEAD)" # error: pathspec ... did not match any file(s) known to git
git checkout "$(git rev-parse HEAD)" # works
Fix
Drop the separator:
if err := runGitIn(ref.Dest, "checkout", ref.Ref); err != nil {
git checkout <sha> -- (separator last) also works, but the plain form is what the surrounding comment already describes.
Versions
Present in v0.10.4, v0.10.5 and v0.10.6 — the same line in all three.
Already fixed on main / v1.0.0-rc3, where CloneGit was rewritten to git fetch --depth 1 origin <commit> followed by git checkout --detach FETCH_HEAD. So this only affects the 0.10 line.
Impact
Any agent using skills.gitRefs with a commit SHA — which is the recommended way to pin skills — cannot start on 0.10.x. Branch and tag refs are unaffected.
- Ngôn ngữ chính
- Go
- Star
- 4.1k
- Fork
- 871
- Merge trung bình
- 1 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 183
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc 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.
Issue khác của kagent-dev/kagent
-
Gemini catalogs omit gemini-4-argon and gemini-3.8-flashCó thể đã có người làm @jayunit100 đã nhận 3 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
kagent-dev/kagent#3524 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Don't add the provider's public host to egress when a ModelConfig sets baseUrlCó thể đã có người làm @lakshyab20 đã nhận 2 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 81/100
kagent-dev/kagent#3507 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] OpenAI and Ollama adapters send an empty tool message when a tool returns a dictCó thể đã có người làm @helloxjade đã nhận 6 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
kagent-dev/kagent#3462 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
kagent-dev/kagent#3428 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG]Có thể đã có người làm @helloxjade đã nhận 10 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
kagent-dev/kagent#3385 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của kagent-dev/kagent
Issue tương tự
-
agent-butler-finding chore
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
jordansmall/spindrift#6695 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
book-layout.spec fails when the similar-books rail holds other projects' booksCó thể đã có người làm @praetorianer777 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
praetorianer777/GoTome#373 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
-
/shutdown/ready can fail to return an HTTP response when readiness takes longer than the server write timeoutCó thể đã có người làm @floriankoch đã nhận hôm nay. Đang mởtriage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
envoyproxy/gateway#10562 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Adding an LDAP group reports every search failure as "LDAP Group DN is not found"Có thể đã có người làm @Daksha1611 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày