fix(review): prevent duplicate comment replies on re-review#1725
Conversation
|
@Koan-Bot review |
1 similar comment
|
@Koan-Bot review |
|
Reviewed the PR. The self-reply detection approach in One thing worth tightening: the prefix-matching after stripping The in-progress dedup fix in Overall: merge-ready with the prefix-matching caveat as a follow-up consideration. |
PR Review — fix(review): prevent duplicate comment replies on re-reviewSolid fix for a real user-facing problem (duplicate review replies). The core self-reply detection logic is correct, well-tested, and addresses the root cause cleanly.
🟡 Important1. Cooldown infra is dead code (unused) (`koan/app/github_notification_tracker.py`, L162-179)The PR description says this cooldown infrastructure is "not currently wired." Dead code that ships untested-in-production tends to bit-rot or mislead future readers into thinking it's already active. Two options:
If you keep it, add a brief 2. Stripping `...` creates over-broad prefix matching (`koan/app/review_runner.py`, L148)When a bot reply quotes For comments whose first lines share a common prefix this produces false-positive filtering — the bot would silently skip an unreplied human comment because a different comment happened to share the same prefix. Safer fix: after stripping Checklist
Silent Failure Analysis🟡 **MEDIUM** — swallowed exception (`koan/app/github_notification_tracker.py:176-177`)Risk: If persisting the review cooldown fails silently, the re-review feedback loop this feature is designed to prevent will occur with no diagnostic trace — unlike the identical pattern 30 lines above which at least has an explanatory comment. Fix: Add Automated review by Kōan (Claude · model claude-opus-4-6)4ac80f1 |
|
@Koan-Bot rebase |
Two fixes for the regression where reviews post duplicate comments: 1. Issue comment self-reply detection: _fetch_issue_comments now collects bot replies and excludes human comments the bot already replied to. Bot replies use "> @user: text..." format — match that quote pattern against human comments to detect prior replies. This is the primary fix for the visible symptom (repeated identical replies). 2. In-progress dedup in _try_assignment_notification: the existing pending-mission check now also scans In Progress, preventing re-queuing while a review is still running. Also adds review cooldown infrastructure to the notification tracker (not yet wired — available for future use if needed). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rebase with requested adjustmentsBranch Changes applied
StatsActions performed
CI statusCI will be checked asynchronously. Automated by Kōan |
4ac80f1 to
64a073a
Compare
What
Stop the bot from posting duplicate replies to the same PR comments on re-review.
Why
After each push/rebase,
review_requestednotifications trigger a new/reviewwith a fresh SHA-based dedup key. Each review re-replies to all human issue comments because_fetch_issue_commentshad no self-reply detection for flat (non-threaded) issue comments. This created a feedback loop: review → rebase → new SHA → re-review → same replies posted again.Example: PR #1697 received 6 identical replies to the same comment; PR #1724 received 3 rounds of duplicate reviews within 30 minutes.
How
Issue comment self-reply detection (
review_runner.py): New_exclude_replied_issue_comments()detects bot replies by matching the> @user: text...quote pattern against human comments._fetch_issue_commentsnow collects bot comments and filters already-replied human comments before returning the "repliable" list.In-progress mission dedup (
github_command_handler.py):_try_assignment_notificationnow checks both Pending AND In Progress sections of missions.md, preventing re-queuing while a review is still running.Review cooldown infrastructure (
github_notification_tracker.py): Addedis_review_on_cooldown()/set_review_cooldown()helpers for future use. Not currently wired — the self-reply detection alone breaks the visible symptom.Testing
_fetch_issue_comments🤖 Generated with Claude Code
Quality Report
Changes: 5 files changed, 209 insertions(+), 11 deletions(-)
Code scan: clean
Tests: failed (1 failed, 403
tests)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline