From d8ef3a9d3283680b57e35e232a9a2746cb6fca1b Mon Sep 17 00:00:00 2001 From: Claude Code Bot Date: Sat, 27 Jun 2026 20:52:29 -0500 Subject: [PATCH] fix(pr-review-mention): break the ack self-comment recursion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The handle-mention job posts an acknowledgement comment that itself contains '@donpetry-bot', via a PAT (DON_PETRY_BOT_GH_PAT) — and PAT-authored comments DO re-trigger workflows (unlike GITHUB_TOKEN). With no guard, each ack re-satisfies the comment trigger and posts another ack, looping every ~8s until GitHub's 2500-comment cap (observed live on .github-private#959: ~2500 acks, then a failure when commenting got disabled). Add a recursion guard to the comment branch of the job `if:`: skip any comment carrying our own ack marker `pr-review-agent mention-ack`. Match on the marker rather than the bot actor because donpetry-bot is also a human account whose own @-mention review requests must still fire. Pre-existing in all versions (the trigger logic is identical across the channel releases); surfaced by the #870 soak when the candidate ran on .github-private. --- .github/workflows/pr-review-mention-reusable.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/pr-review-mention-reusable.yml b/.github/workflows/pr-review-mention-reusable.yml index 2aa7bfa23..201837244 100644 --- a/.github/workflows/pr-review-mention-reusable.yml +++ b/.github/workflows/pr-review-mention-reusable.yml @@ -37,6 +37,13 @@ jobs: # team review requests; comment fields don't exist on pull_request events. # For comment events we also gate at the job level on author_association so # that the job (and its secrets) never start for external/untrusted actors. + # + # Recursion guard: the ack comment this job posts itself contains + # '@donpetry-bot' and is posted via a PAT (so it DOES re-trigger workflows, + # unlike GITHUB_TOKEN), which without this guard self-loops until GitHub's + # 2500-comment cap. Skip any comment carrying our own ack marker. We match on + # the marker (not the bot actor) because donpetry-bot is also a human account + # whose own @-mention review requests must still fire. if: | (github.event_name == 'pull_request' && github.event.requested_reviewer != null && @@ -44,6 +51,7 @@ jobs: github.event.pull_request.head.repo.full_name == github.repository) || (github.event_name != 'pull_request' && contains(github.event.comment.body, '@donpetry-bot') && + !contains(github.event.comment.body, 'pr-review-agent mention-ack') && contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association) && (github.event_name == 'pull_request_review_comment' || github.event.issue.pull_request != null))