fix: review-poll floods PRs with error comments on repeated failure #193
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
When review-pr.sh fails (OOM, claude crash, bad output), review-poll.sh retries every 5 minutes and review-pr.sh posts a new "Review failed" error comment each time. There is no circuit breaker.
Observed on PR #191: 49 identical error comments posted over ~8 hours.
Root cause
Two gaps:
review-poll.sh (line 155-164) checks for formal forge reviews to skip already-reviewed PRs, but error comments use HTML markers (review-error), not formal reviews. The poll never detects prior failures.
review-pr.sh (line 249) unconditionally posts a new error comment on failure without checking how many already exist.
Proposed solution
In review-poll.sh, before calling review-pr.sh, count existing review-error comments for the current SHA. If >= 3, skip the PR and log a warning. Pushing a new commit (new SHA) resets the counter.
Affected files
Acceptance criteria