Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

pull_request_read silently ignores pagination parameters that don't apply to the selected method

Đang mở
#3,316 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
76/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
github, go
Lĩnh vực
api, backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Describe the bug

pull_request_read exposes two pagination mechanisms in one schema:

  • page / perPage — used by get_files, get_commits, get_reviews, get_comments, get_check_runs
  • after (cursor) — used only by get_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

  1. Call pull_request_read with method: "get_files" on a PR with more
    than one page of changed files, perPage: 10.
  2. Take any non-empty string as after and call again with the same
    method, perPage: 10, after: "<value>".
  3. Observe: the response is identical to step 1. No error.

Or:

  1. Call with method: "get_review_comments", page: 2.
  2. Observe: page is 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.

Ngôn ngữ chính
Go
Star
33.1k
Fork
5k
Merge trung bình
2 ngày 1 giờ
Pull request đã merge (30 ngày)
25

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của github/github-mcp-server

Tất cả issue của github/github-mcp-server

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.