Repository resource completions hide branch, tag, and commit lookup errors
Maintainer antworten meist innerhalb von 2 Tagen
@pei711 arbeitet bereits daran.
Seit 25.10.2026.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 75/100
Rechercherichtung
Suchen Sie completeBranch, completeTag und completeSHA (grep das Repo). Sehen Sie, wie die Repository- und Pull-Request-Completion-Pfade bereits den go-github-Fehler zurückgeben, dann hören Sie auf, ihn mit _ zu verwerfen, und propagieren Sie ihn. Verifizieren Sie mit dem gemockten HTTP-Client, der 403 zurückgibt, dass die Completion nun einen Fehler liefert statt leer zu sein.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Go
- Sterne
- 33.8k
- Forks
- 5.2k
- Ø Merge
- 2 T. 18 Std.
- Gemergte PRs (30 T.)
- 38
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus github/github-mcp-server
-
README: GITHUB_TOOLSETS doesn't take precedence over --toolsets (viper gives the flag priority)Evtl. vergeben @pei711 hat das vor 1 Tag übernommen. Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
github/github-mcp-server#3578 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
github/github-mcp-server#3572 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Add Zero-Docker quick start and clarify no‑Docker options in READMEEvtl. vergeben @Flanxiyum001 hat das vor 13 Tagen übernommen. Offendocumentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
github/github-mcp-server#3495 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Integer parameters equal to 2^63 pass the range check in toInt and wrap to a negative numberEvtl. vergeben @xiao115255 hat das vor 13 Tagen übernommen. Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
github/github-mcp-server#3489 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
github/github-mcp-server#3475 ·
Maintainer antworten meist innerhalb von 2 Tagen
Alle Issues in github/github-mcp-server
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
area/frontend/library-panels automated-triage type/bug type/ux
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug raised-by:verifier
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
medici-finance/assay#4554 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
microsoft/azure-linux-image-tools#954 ·
Maintainer antworten meist innerhalb von 1 Tag
-
help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 1 Tag