Repository resource completions hide branch, tag, and commit lookup errors
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 75/100
Línea de trabajo
Localice completeBranch, completeTag y completeSHA (grep el repo). Vea cómo las rutas de completion de repository y pull-request ya devuelven el error de go-github, luego deje de descartarlo con _ y propágelo. Verifique con el cliente HTTP mockeado que devuelve 403 que la completion ahora da error en lugar de vacío.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Go
- Estrellas
- 33.8k
- Forks
- 5.2k
- Merge medio
- 2 d 18 h
- PR fusionados (30 d)
- 38
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de github/github-mcp-server
-
README: GITHUB_TOOLSETS doesn't take precedence over --toolsets (viper gives the flag priority)Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
github/github-mcp-server#3578 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
github/github-mcp-server#3572 ·
Los mantenedores suelen responder en 2 días
-
Add Zero-Docker quick start and clarify no‑Docker options in READMEPosiblemente ocupada @Flanxiyum001 la tomó hace 11 días. Abiertodocumentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
github/github-mcp-server#3495 ·
Los mantenedores suelen responder en 2 días
-
Integer parameters equal to 2^63 pass the range check in toInt and wrap to a negative numberPosiblemente ocupada @xiao115255 la tomó hace 12 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
github/github-mcp-server#3489 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
github/github-mcp-server#3475 ·
Los mantenedores suelen responder en 2 días
Todos los issues de github/github-mcp-server
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
prime-radiant-inc/evener#5028 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
[BUG] v4.2.9 PostgreSQL 启动迁移失败:DROP INDEX CURRENT_SCHEMA() 语法错误Posiblemente ocupada @renovate la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
OpenListTeam/OpenList#3267 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
'ignore' is called 'deny'Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
openpubkey/opkssh#670 ·
Los mantenedores suelen responder en 1 día