Commit bb3825a
fix: review-agent dedup bot review bodies with inline comments (#78134)
The comment analyzer flags review bodies and review threads
independently. When an approved bot (e.g. CodeRabbit) submits a review
with both a body and inline comments, both get flagged as separate
needs_attention items. Claude addresses each independently, producing
duplicate responses.
Observed on openshift/hypershift#8280: CodeRabbit review #4146142149
had a body ("Actionable comments posted: 1") and one inline comment
about trust bundle sync stalling. The analyzer returned both as
separate items. Claude posted an inline reply to the thread at
11:04:10Z, then two issue comments at 11:04:20Z and 11:06:19Z —
both "Re: #pullrequestreview-4146142149" with overlapping content.
Root cause: analyze_review_bodies uses per-comment reply matching
(checking if any bot comment references the review ID/URL). Since no
bot comment had yet referenced review 4146142149, it was flagged.
Meanwhile, analyze_review_threads independently flagged the same
review's inline thread. Both items entered the needs_attention list.
Fix: add comments { totalCount } to the reviews GraphQL query and
skip approved bot review bodies when inline comments exist. Bot
review bodies are machine-generated summaries of their inline
comments (already handled by analyze_review_threads). Human review
bodies are always kept since they often contain distinct feedback.
Verified against PR #8280:
- CodeRabbit review 4146142149: SKIPPED (approved_bot, inline_count=1)
- CodeRabbit review 4138831511: SKIPPED (approved_bot, inline_count=1)
- csrwng review 4144456157: KEPT (human, inline_count=2)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 8a83a38 commit bb3825a
1 file changed
Lines changed: 10 additions & 0 deletions
File tree
- ci-operator/step-registry/hypershift/review-agent/process
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
| 420 | + | |
420 | 421 | | |
421 | 422 | | |
422 | 423 | | |
| |||
463 | 464 | | |
464 | 465 | | |
465 | 466 | | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
466 | 476 | | |
467 | 477 | | |
468 | 478 | | |
| |||
0 commit comments