Conversation
…hod does not support
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
pull_request_readaccepts two pagination styles in one schema —page/perPagefor the REST-backed list methods and
after(a GraphQL cursor) forget_review_comments. A parameter the selected method could not use wasdropped silently, so a caller passing
aftertoget_filesreceived thefirst page again with no signal that nothing had advanced.
This adds a guard before the method dispatch that returns a tool error naming
the method and the unsupported parameter:
get_review_commentsrejectspageget_files,get_commits,get_reviews,get_comments,get_check_runsrejectafterget,get_diff,get_statusreject all three, since they return a single objectCalls that already use the right parameters are unaffected.
Why
For an LLM caller a schema description is guidance, not enforcement. The
description for
afteralready says it is only forget_review_comments,but the model still sees a pagination cursor in the schema and reaches for
it when it wants the next page of files. Silent drops are the worst outcome
for that caller: the response is plausible, so it never retries.
Follow-up to #2489, which exposed
afterin the schema but did not add theguard; same failure class as #2347.
Testing
go test ./pkg/github/...passes. AddedTest_rejectUnsupportedPaginationcovering the accepted and rejected combination for each method group.
Fixes #3316