Proposal: improve pr-self-reviewer — add deduplication guard to prevent duplicate review spam #4950

Open
opened 2026-04-08 23:39:39 +00:00 by freemo · 2 comments
Owner

Agent Improvement Proposal

Pattern Detected

Type: workflow_fix
Affected Agent: pr-self-reviewer
Evidence:

  • PR #3466 has 46 reviews — 45 COMMENT-type reviews from the same bot account (freemo/HAL9000) posted over multiple sessions. This is extreme review spam.
  • PR #3911 has 13 REQUEST_CHANGES reviews from the same bot in a single day (2026-04-06), all with nearly identical content.
  • PR #3473 has 9 reviews — 8 COMMENT reviews from the same bot.
  • Pattern: continuous-pr-reviewer dispatches a new pr-self-reviewer instance every 30 seconds if the PR is still open, without checking whether a review was already recently posted. Each pr-self-reviewer instance then posts a new review without checking if it already reviewed this PR in a recent session.

Proposed Change

Add a deduplication guard at the start of pr-self-reviewer's review process:

Before posting any review, the agent should:

  1. Fetch all existing reviews on the PR via the Forgejo API
  2. Check if there is already a review from the bot account (HAL9000 or the configured Forgejo username) posted within the last 4 hours
  3. If a recent review exists AND the PR's HEAD SHA hasn't changed since that review, skip posting and exit with a note that a recent review already exists
  4. Only post a new review if: (a) no recent review exists, OR (b) the PR has new commits since the last review

This prevents the same PR from accumulating dozens of identical reviews when the continuous-pr-reviewer keeps re-dispatching reviewers to the same stuck PR.

Expected Impact

  • Eliminates review spam (PRs accumulating 10-50+ identical reviews)
  • Reduces noise in PR comment threads, making it easier for humans to read actual review feedback
  • Reduces API load from redundant review posts
  • Prevents the Forgejo review count from becoming meaningless

Risk Assessment

  • Low risk: The guard only prevents posting duplicate reviews. If the PR has new commits, a fresh review will still be posted.
  • Potential downside: If the bot's review was incorrect or incomplete, the guard might prevent a corrective review. Mitigation: use a short window (4 hours) and always allow re-review when HEAD SHA changes.
  • Edge case: If the bot account name changes, the deduplication check needs updating. Mitigation: use the configured FORGEJO_USERNAME env var rather than hardcoding.

This is a proposal from the agent evolver. A human must approve this issue before the change will be implemented. To approve: remove the needs feedback label, add State/Verified, or comment with approval.


Automated by CleverAgents Bot
Supervisor: Agent Evolver | Agent: agent-evolver

## Agent Improvement Proposal ### Pattern Detected **Type**: workflow_fix **Affected Agent**: `pr-self-reviewer` **Evidence**: - PR #3466 has **46 reviews** — 45 COMMENT-type reviews from the same bot account (`freemo`/HAL9000) posted over multiple sessions. This is extreme review spam. - PR #3911 has **13 REQUEST_CHANGES reviews** from the same bot in a single day (2026-04-06), all with nearly identical content. - PR #3473 has **9 reviews** — 8 COMMENT reviews from the same bot. - Pattern: `continuous-pr-reviewer` dispatches a new `pr-self-reviewer` instance every 30 seconds if the PR is still open, without checking whether a review was already recently posted. Each `pr-self-reviewer` instance then posts a new review without checking if it already reviewed this PR in a recent session. ### Proposed Change Add a **deduplication guard** at the start of `pr-self-reviewer`'s review process: Before posting any review, the agent should: 1. Fetch all existing reviews on the PR via the Forgejo API 2. Check if there is already a review from the bot account (`HAL9000` or the configured Forgejo username) posted within the last **4 hours** 3. If a recent review exists AND the PR's HEAD SHA hasn't changed since that review, **skip posting** and exit with a note that a recent review already exists 4. Only post a new review if: (a) no recent review exists, OR (b) the PR has new commits since the last review This prevents the same PR from accumulating dozens of identical reviews when the `continuous-pr-reviewer` keeps re-dispatching reviewers to the same stuck PR. ### Expected Impact - Eliminates review spam (PRs accumulating 10-50+ identical reviews) - Reduces noise in PR comment threads, making it easier for humans to read actual review feedback - Reduces API load from redundant review posts - Prevents the Forgejo review count from becoming meaningless ### Risk Assessment - **Low risk**: The guard only prevents posting duplicate reviews. If the PR has new commits, a fresh review will still be posted. - **Potential downside**: If the bot's review was incorrect or incomplete, the guard might prevent a corrective review. Mitigation: use a short window (4 hours) and always allow re-review when HEAD SHA changes. - **Edge case**: If the bot account name changes, the deduplication check needs updating. Mitigation: use the configured `FORGEJO_USERNAME` env var rather than hardcoding. --- *This is a proposal from the agent evolver. A human must approve this issue before the change will be implemented. To approve: remove the `needs feedback` label, add `State/Verified`, or comment with approval.* --- **Automated by CleverAgents Bot** Supervisor: Agent Evolver | Agent: agent-evolver
Author
Owner

This issue has the "Needs Feedback" label and is a proposal awaiting human review. I will not modify its state — a human must approve or reject it.

Summary of the proposal:
The agent-evolver has identified extreme review spam: PR #3466 has 46 reviews (45 COMMENT-type from the same bot), PR #3911 has 13 REQUEST_CHANGES reviews in a single day, and PR #3473 has 9 reviews. The pr-self-reviewer posts new reviews without checking if it already reviewed this PR in a recent session.

Proposed fix: Add a deduplication guard to pr-self-reviewer that checks existing reviews before posting, and skips if a review was already posted at the current HEAD commit.

To approve: Remove the "Needs Feedback" label and add "State/Verified", or comment with explicit approval.


Automated by CleverAgents Bot
Supervisor: Human Liaison | Agent: human-liaison

This issue has the "Needs Feedback" label and is a proposal awaiting human review. I will not modify its state — a human must approve or reject it. **Summary of the proposal:** The agent-evolver has identified extreme review spam: PR #3466 has 46 reviews (45 COMMENT-type from the same bot), PR #3911 has 13 REQUEST_CHANGES reviews in a single day, and PR #3473 has 9 reviews. The `pr-self-reviewer` posts new reviews without checking if it already reviewed this PR in a recent session. **Proposed fix:** Add a deduplication guard to `pr-self-reviewer` that checks existing reviews before posting, and skips if a review was already posted at the current HEAD commit. **To approve:** Remove the "Needs Feedback" label and add "State/Verified", or comment with explicit approval. --- **Automated by CleverAgents Bot** Supervisor: Human Liaison | Agent: human-liaison
Owner

This is a proposal awaiting human review (needs feedback label). I will not modify its state — a human must approve or reject it.

Summary of proposal: Add a deduplication guard to pr-self-reviewer to prevent review spam. Evidence: PR #3466 accumulated 46 reviews, PR #3911 accumulated 13 REQUEST_CHANGES reviews in a single day — all from the same bot.

Proposed guard: Before posting any review, check if a review from the bot account was posted within the last 4 hours AND the PR HEAD SHA hasn't changed. If so, skip posting.

Risk assessment (from proposal): Low — only prevents duplicate reviews; fresh reviews still posted when HEAD SHA changes.

For human review: Please comment with approval or rejection, or remove the Needs Feedback label to proceed with implementation.


Automated by CleverAgents Bot
Supervisor: Human Liaison | Agent: human-liaison

This is a proposal awaiting human review (`needs feedback` label). I will not modify its state — a human must approve or reject it. **Summary of proposal:** Add a deduplication guard to `pr-self-reviewer` to prevent review spam. Evidence: PR #3466 accumulated 46 reviews, PR #3911 accumulated 13 REQUEST_CHANGES reviews in a single day — all from the same bot. **Proposed guard:** Before posting any review, check if a review from the bot account was posted within the last 4 hours AND the PR HEAD SHA hasn't changed. If so, skip posting. **Risk assessment (from proposal):** Low — only prevents duplicate reviews; fresh reviews still posted when HEAD SHA changes. **For human review:** Please comment with approval or rejection, or remove the `Needs Feedback` label to proceed with implementation. --- **Automated by CleverAgents Bot** Supervisor: Human Liaison | Agent: human-liaison
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#4950
No description provided.