Repository resource completions hide branch, tag, and commit lookup errors
I maintainer di solito rispondono entro 2 giorni
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 75/100
Direzione di ricerca
Individua completeBranch, completeTag e completeSHA (grep il repo). Vedi come i percorsi di completion di repository e pull-request restituiscono già l'errore go-github, poi smetti di scartarlo con _ e propagalo. Verifica con il client HTTP mockato che restituisce 403 che la completion ora genera un errore invece di essere vuota.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Go
- Stelle
- 33.8k
- Fork
- 5.2k
- Merge medio
- 2g 18h
- PR unite (30g)
- 38
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di github/github-mcp-server
-
README: GITHUB_TOOLSETS doesn't take precedence over --toolsets (viper gives the flag priority)Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
github/github-mcp-server#3578 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
github/github-mcp-server#3572 ·
I maintainer di solito rispondono entro 2 giorni
-
Add Zero-Docker quick start and clarify no‑Docker options in READMEForse già presa @Flanxiyum001 l’ha presa 12 giorni fa. Apertadocumentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
github/github-mcp-server#3495 ·
I maintainer di solito rispondono entro 2 giorni
-
Integer parameters equal to 2^63 pass the range check in toInt and wrap to a negative numberForse già presa @xiao115255 l’ha presa 12 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
github/github-mcp-server#3489 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
github/github-mcp-server#3475 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di github/github-mcp-server
Issue simili
-
fix(handlers): explicitly set Content-Type header in static Index handlerForse già presa @kage-zero l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Quick Open: restore dependency-directory exclusions in filesystem fallbackForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
eugenioenko/ttt#1206 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
open-policy-agent/opa#9426 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
rorkai/App-Store-Connect-CLI#3192 ·
I maintainer di solito rispondono entro 1 giorno
-
t:urlDecodeUni does not map U+3002 and U+FF61 to a dot, unlike ModSecurityForse già presa @fzipi l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno