Skip to content

Post the review bot's findings as one grouped PR review - #5673

Merged
tianyu-l merged 1 commit into
mainfrom
ai-review-grouped
Oct 29, 2026
Merged

tianyu-l merged 1 commit into
mainfrom
ai-review-grouped

Conversation

@tianyu-l

Copy link
Copy Markdown
Contributor

Why

The first @claude review with the new skill (#5664) put four separate items on the PR:

Item Cause
2 empty COMMENTED reviews, each holding one inline comment create_inline_comment posts every comment on its own, so GitHub wraps each one in a single-comment review
1 APPROVED review with the summary gh pr review
1 tracking comment repeating the same summary the bot also wrote the summary into its tracking comment

The reviewer has to read the same review twice, and the inline comments are detached from the verdict.

Example. After this PR, the same run produces:

claude[bot] commented:   Approve -- <one-line reason>. Review: <link>
claude[bot] approved:    <verdict, summary, example, pointers>
    packing.py:381          <inline comment>
    test_grain_data.py:1200 <inline comment>

What changed

  • Skill. pr-review now posts with the GitHub MCP server's pending-review tools, which ship with the pinned claude-code-action:

    1. create_pending_pull_request_review
    2. add_comment_to_pending_review, once per line-anchored finding
    3. submit_pending_pull_request_review with the body and APPROVE / REQUEST_CHANGES / COMMENT

    If a pending review is left over from an interrupted run, the bot deletes it and retries. If the pending-review tools are unavailable, it falls back to the previous path (inline tool, then gh pr review) and never posts a finding through both.

  • Tracking comment. After a review it is one line: the verdict and a link to the review.

  • claude-code.yml. Allows only those four pending-review tools from the GitHub MCP server. Other tools in that server, such as merge, and gh api stay blocked.

Testing

The change only takes effect from main, so it can't be exercised before merging. After merge, run @claude review on a PR with line-level findings and check that the result is one review containing the inline comments, plus a one-line tracking comment.

Known issues

  • Not verified: the pending-review tools look up "the caller's pending review" through GraphQL viewer. That should resolve to claude[bot] with the app's installation token, but this hasn't been checked. If it fails, the bot falls back to the previous ungrouped posting.
  • Not verified: if the lookup fails after a pending review was created, that pending review stays behind. It is invisible to others, and later runs fall back the same way.

The inline-comment tool creates each comment as its own single-comment review,
and the tracking comment repeated the review summary, so #5664 got four
separate items. Use the GitHub MCP server's pending-review tools to post the
body, verdict and inline comments as one review, keep gh pr review and the
inline tool as a fallback, and shrink the tracking comment to one line.
@tianyu-l
tianyu-l requested review from fegin and wwwjn as code owners October 29, 2026 05:43
@pytorch-bot pytorch-bot Bot added the ciflow/fake-pg Run 1-GPU Fake PG integration tests label Oct 29, 2026
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 29, 2026
@tianyu-l
tianyu-l merged commit 38196e2 into main Oct 29, 2026
19 checks passed
@tianyu-l
tianyu-l deleted the ai-review-grouped branch October 29, 2026 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/fake-pg Run 1-GPU Fake PG integration tests CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants