Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Warn when review comment payload may be truncated#1579

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
AvenJose wants to merge1 commit intogithub:main
base:main
Choose a base branch
Loading
fromAvenJose:warn-large-review-comments-payload

Conversation

@AvenJose
Copy link

Adds a small heuristic warning topull_request_read:get_review_comments when the marshaled payload is large enough that some MCP clients may truncate it.

Motivation: large review comments (bigdiff_hunk/bodies) can cause the tool response to be cut off, hiding later comments and confusing agents. The warning suggests retrying with a smallerperPage.

Changes:

  • pkg/github/pullrequests.go: if payload > ~8KB, return a leading WARNING text block plus the JSON.
  • pkg/github/pullrequests_test.go: new unit test covering the warning path.

Behavior is unchanged for normal-sized payloads.

@AvenJoseAvenJose requested a review froma team as acode ownerDecember 12, 2025 02:33
CopilotAI review requested due to automatic review settingsDecember 12, 2025 02:33
Copy link
Contributor

CopilotAI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Pull request overview

This PR adds a heuristic warning to theget_review_comments method when the marshaled payload exceeds approximately 8KB. This helps AI agents identify when MCP clients may truncate responses, suggesting they retry with a smallerperPage parameter to avoid missing comments.

Key changes:

  • Introduced a threshold constant (8KB) to detect potentially truncated payloads
  • Modified the response format to include a warning message when the threshold is exceeded
  • Added comprehensive test coverage for the large payload warning scenario

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

FileDescription
pkg/github/pullrequests.goAddedmcpLargePayloadWarningThresholdBytes constant and logic to return a multi-content result (warning + data) when payload size exceeds threshold
pkg/github/pullrequests_test.goAdded unit test that creates a large payload scenario and verifies both warning and data content are returned correctly

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

+1 more reviewer

@ewanlister-jpgewanlister-jpgewanlister-jpg approved these changes

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@AvenJose@ewanlister-jpg

[8]ページ先頭

©2009-2025 Movatter.jp