Repository resource completions hide branch, tag, and commit lookup errors
Maintainer thường phản hồi trong vòng 2 ngày
@pei711 đang làm issue này rồi.
Từ ngày 25/10/2026.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 75/100
Hướng nghiên cứu
Tìm completeBranch, completeTag và completeSHA (grep repo). Xem cách các đường dẫn completion của repository và pull-request đã trả về lỗi go-github, sau đó ngừng loại bỏ nó bằng _ và lan truyền nó. Xác minh với client HTTP mocked trả về 403 rằng completion giờ đây báo lỗi thay vì trống rỗng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
Repository resource completions silently turn GitHub API failures into an empty successful result for branches, tags, and commit SHAs.
completeBranch, completeTag, and completeSHA all discard the error returned by the corresponding go-github call. If the API returns a 403, 404, rate-limit response, or a transport error, the MCP client receives a completion response with no values instead of an error. From the client side this looks exactly like the repository has no branches, tags, or commits, which makes authentication and access problems difficult to diagnose.
Affected version
I reproduced this on v2.0.3 and current main (f385262).
Steps to reproduce the behavior
I used the repository's existing mock HTTP client to return a 403 from the branches endpoint, then called completeBranch:
client, _ := github.NewClient(github.WithHTTPClient(
NewMockedHTTPClient(WithRequestMatchHandler(
"GET /repos/{owner}/{repo}/branches",
func(w http.ResponseWriter, _ *http.Request) {
http.Error(w, "rate limited", http.StatusForbidden)
},
)),
))
values, err := completeBranch(
context.Background(),
client,
map[string]string{"owner": "o", "repo": "r"},
"",
)
The result is an empty values slice and a nil error. The same thing happens in completeSHA and completeTag because those functions also assign the API error to _.
Expected vs actual behavior
I would expect the completion request to return the GitHub API error, as the repository and pull-request completion paths already do.
Instead, the error is lost and the handler reports a successful empty completion (values: [], total: 0, hasMore: false). Propagating the errors from ListBranches, ListCommits, and ListTags should preserve the useful status and message for the MCP client.
Logs
The regression assertion fails with:
Error: An error is expected but got nil.
- Ngôn ngữ chính
- Go
- Star
- 33.8k
- Fork
- 5.2k
- Merge trung bình
- 2 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 38
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- 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 github/github-mcp-server
-
README: GITHUB_TOOLSETS doesn't take precedence over --toolsets (viper gives the flag priority)Có thể đã có người làm @pei711 đã nhận 1 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
github/github-mcp-server#3578 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
github/github-mcp-server#3572 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Add Zero-Docker quick start and clarify no‑Docker options in READMECó thể đã có người làm @Flanxiyum001 đã nhận 13 ngày trước. Đang mởdocumentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
github/github-mcp-server#3495 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Integer parameters equal to 2^63 pass the range check in toInt and wrap to a negative numberCó thể đã có người làm @xiao115255 đã nhận 13 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
github/github-mcp-server#3489 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
github/github-mcp-server#3475 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của github/github-mcp-server
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area/frontend/library-panels automated-triage type/bug type/ux
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
deskevidence: --dry-run is ignored with --outcome-record, so the record is committed for realĐang mởbug raised-by:verifier
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
medici-finance/assay#4554 · 1 bình luận ·
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 67/100
microsoft/azure-linux-image-tools#954 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày