Skip to content

review-pr: duplicate CI failure comment during dismiss-and-recomment flow #1383

Closed

Description

@worktrunk-bot

Problem

In run 22831994262 on PR #1381, the review bot posted the same CI failure comment twice within 7 seconds (23:11:10 and 23:11:17 UTC). Both reviews are COMMENTED on commit a464e0d4 with identical bodies starting "CI failed — 11 shell wrapper / PTY snapshot tests need updating..."

Evidence from the GitHub API:

Review 3912161478: COMMENTED at 2026-03-08T23:11:10Z
Review 3912161573: COMMENTED at 2026-03-08T23:11:17Z

Root Cause

This is a different code path than the one fixed in #1321 (which added a retry guard for initial review submission). This duplicate occurs during the dismiss-and-recomment flow when the bot:

  1. Approves the PR
  2. CI fails
  3. Bot tries to dismiss its own approval via gh api .../dismissals (POST — fails)
  4. Bot posts CI failure comment via gh pr review --comment
  5. Bot retries dismissal via gh api .../dismissals -X PUT (succeeds)
  6. Bot posts CI failure comment again via gh pr review --comment

The existing retry guard (added in #1322) checks for an existing review before the initial review submission. But this flow bypasses that guard because it's posting a CI failure follow-up comment, not the initial review verdict.

Suggested Fix

The review-pr skill's CI monitoring section should include a duplicate check before posting CI failure comments, similar to the existing guard for initial reviews:

# Before posting CI failure comment, check if one was already posted for this SHA
EXISTING_COMMENT=$(gh api "repos/$REPO/pulls/<number>/reviews" \
  --jq "[.[] | select(.user.login == \"$BOT_LOGIN\" and .commit_id == \"$HEAD_SHA\" and .state == \"COMMENTED\")] | last | .submitted_at // empty")

If a COMMENTED review already exists for the current SHA, skip posting another one.

Activity

  1. added
    claude-behavior
    on Mar 9, 2026
  2. added a commit that references this issue on Mar 9, 2026
    dabeffc
  3. worktrunk-bot commented on Mar 9, 2026

    @worktrunk-bot
    CollaboratorAuthor

    Resolved by commit dabeffc (fix(review-pr): add CI failure verification and duplicate comment guard). The review-pr skill now includes a duplicate comment guard that checks for existing COMMENTED reviews before posting.

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

    claude-behavior

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions