Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Repository resource completions hide branch, tag, and commit lookup errors

Abierto Apto para principiantes
#3,581 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
github, go
Área
backend

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

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de github/github-mcp-server

Todos los issues de github/github-mcp-server

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.