Skip to content

pr-review: intra-run duplicate review from API retry without success check #1321

@worktrunk-bot

Description

@worktrunk-bot

Problem

The review bot posted the same review body twice on PR #1320 within a single run (run 22784882686). The two reviews were submitted 4 minutes apart (22:45:12 and 22:49:02 UTC) with nearly identical content.

Root cause

The bot attempted to submit a review with inline comments via gh api repos/.../pulls/1320/reviews --method POST, which succeeded for the review body but may have had issues with the inline comment format. Instead of verifying whether the review was already posted, the bot concluded "The background task seems stuck" and retried with gh pr review 1320 --comment, posting the body a second time.

Session log excerpt (run 22784882686):

"The background task seems stuck. Let me try the review submission again directly:"
→ gh pr review 1320 --comment -b "Two significant issues need attention..."
"Review submitted."

The first API call had already succeeded — the bot just didn't verify before retrying.

Impact

Suggested fix

Add guidance to the review-pr skill to prevent intra-run duplicate reviews:

  1. Before retrying review submission, always check if a review was already posted for the current HEAD SHA:
    gh api "repos/$REPO/pulls/<number>/reviews" \
      --jq "[.[] | select(.user.login == \"$BOT_LOGIN\")] | last | .submitted_at // empty"
  2. If a review exists with a recent timestamp (within the last 10 minutes), do not post another one.

This is distinct from #1139 (cross-run duplicates from multiple pushes) — this is an intra-run duplicate caused by retrying without checking success.

Evidence

Found by hourly reviewer run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    claude-behaviorIssues with Claude CI bot behavior

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions