pull_request_read silently ignores pagination parameters that don't apply to the selected method
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 76/100
Piste de recherche
Start in pullrequests.go at the pull_request_read dispatch and review the existing method validation before dispatching. Use utils.NewToolResultError for unsupported pagination parameters, naming the selected method and parameter; done means mismatched page/perPage or after inputs return clear validation errors instead of being ignored.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Describe the bug
pull_request_read exposes two pagination mechanisms in one schema:
page/perPage— used byget_files,get_commits,get_reviews,get_comments,get_check_runsafter(cursor) — used only byget_review_comments
When a caller passes a parameter the selected method doesn't use, the
server silently drops it and returns results as if it were never sent.
There is no error, warning, or hint in the response.
The schema description for after does say "used only by the
get_review_comments method", and the code comment confirms other methods
"ignore after" — but for an LLM caller a description is guidance, not
enforcement. The model sees a pagination cursor in the schema, receives a
page of files, and passes after to fetch the next page. It gets the first
page again and has no signal that anything was ignored.
The symmetric case also applies: passing page to get_review_comments
is silently ignored.
Steps to reproduce
- Call
pull_request_readwithmethod: "get_files"on a PR with more
than one page of changed files,perPage: 10. - Take any non-empty string as
afterand call again with the same
method,perPage: 10,after: "<value>". - Observe: the response is identical to step 1. No error.
Or:
- Call with
method: "get_review_comments",page: 2. - Observe:
pageis ignored, first page is returned.
Expected behavior
A pagination parameter that the selected method cannot honour should
produce a validation error naming the method and the parameter, e.g.
method "get_files" uses page/perPage pagination; "after" is not supported. This is consistent with how the tool already rejects an
unknown method.
Why this matters
Silent parameter drops are worst-case for agentic callers: the tool reports
success with a plausible payload, so the model has no reason to retry.
This is the same failure class as #2347 (silent truncation), and a
follow-up to #2489, which added after to the schema but did not add the
guard.
Suggested fix
Before dispatching on method, check whether the caller supplied a
pagination parameter the method doesn't use, and return
utils.NewToolResultError with a clear message. A small helper in
pullrequests.go covers all nine methods.
Happy to open a PR.
- Langage dominant
- Go
- Étoiles
- 33.1k
- Forks
- 5k
- Merge moyen
- 2 j 1 h
- PR mergées (30 j)
- 25
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de github/github-mcp-server
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
github/github-mcp-server#3235 ·
-
enhancement
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
github/github-mcp-server#3042 · 2 commentaires ·
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
github/github-mcp-server#3032 · 1 réaction ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
github/github-mcp-server#2803 · 1 commentaire ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
github/github-mcp-server#2740 ·
Toutes les issues de github/github-mcp-server
Issues similaires
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 60/100
github/gh-aw-mcpg#13748 ·
-
agentic-workflows
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
-
needs-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
googleapis/librarian#7670 · 2 commentaires ·