Skip to content

pr_review.py: review_on_head=NO for a CodeRabbit review confirmed on the exact head SHA #1066

Description

@ptr727

What happened

On PR #1065, after a fix push, `scripts/pr_review.py wait`/`status` reported:

```
repo=ptr727/ProjectTemplate pr=1065 head=99dd1daa ... review_on_head=NO other_reviewed=coderabbitai ... merge=CLEAN checks=8/8
```

Read directly via GraphQL, CodeRabbit's most recent review on this PR carries `commit.oid = 99dd1da`, exactly the current head, submitted at `2026-08-28T19:09:35Z`, state `COMMENTED`, body `````` (empty). It posted no new review threads in that round, all 11 prior threads were already resolved. This is CodeRabbit's normal shape for "reviewed, nothing new to flag," the same terminal outcome `pr-review-conduct`'s "Expected review loop" step 4 already documents as valid. `review_on_head` appears to require a non-empty body (or a coverage marker) to count a review as covering the head, which misses this shape.

Why this matters

`pr-review-conduct`'s Merge Gate requires "A review is confirmed on the current head SHA... the matched review is read, not just counted." An agent that trusts `review_on_head` at face value here would wrongly conclude the head is unreviewed and either loop unnecessarily or escalate, even though a direct read confirms full coverage.

Suggested fix

Count a review as covering the head once its `commit.oid` matches, regardless of an empty body, the same way an empty-body review is already accepted as a valid "no findings" terminal outcome elsewhere in the same script's logic. A rate-limited or refused review should still be distinguished by its own marker (per the CodeRabbit rate-limit marker `pr_review.py` already reads), not by body-emptiness alone.

Where I hit this

PR #1065 (`local-strict-review` skill), during the `drive-pr`/`pr-review-conduct` review loop, 2026-08-28.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions