From 07ecb983892bf90ec1934468a9c9d6dbb62d9123 Mon Sep 17 00:00:00 2001 From: Jakob Wennberg <149234542+jakobwennberg@users.noreply.github.com> Date: Tue, 9 Jun 2026 19:09:54 +0200 Subject: [PATCH] ci(pr-agent): stop bot comments from cancelling the PR review run (#700) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The PR Agent review almost never completed: the workflow triggers on both pull_request and issue_comment and shared one concurrency group (pr-agent-) with cancel-in-progress. Vercel/Supabase/compliance preview bots comment within ~2s of a PR opening, so each issue_comment event queued a run in the same group and cancel-in-progress killed the in-flight review — before the job-level `if: sender.type != 'Bot'` could skip the bot run (concurrency cancellation precedes job evaluation). Add the event_name to the concurrency group so pull_request runs and issue_comment runs no longer collide. A new push (synchronize) still supersedes a stale review; bot comments now cancel only each other (all skipped) and never the open/push review. Co-authored-by: Claude Opus 4.8 (1M context) --- .github/workflows/pr-agent.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-agent.yml b/.github/workflows/pr-agent.yml index dcfcbdea..1222d4fe 100644 --- a/.github/workflows/pr-agent.yml +++ b/.github/workflows/pr-agent.yml @@ -21,9 +21,16 @@ on: issue_comment: types: [created, edited] -# One run per PR; cancel a superseded run when a new push lands. +# One run per PR *per event type*; a new push (pull_request:synchronize) cancels +# a superseded review. The event_name suffix is critical: without it, the +# pull_request and issue_comment triggers share a group, so a bot comment +# (Vercel/Supabase/compliance preview bots fire within ~2s of opening a PR) +# queues an issue_comment run that cancel-in-progress kills the real review with — +# before the job-level `if: sender.type != 'Bot'` ever gets to skip it. Keeping the +# groups separate lets comment runs cancel only each other (all skipped, harmless) +# and never the open/push review. concurrency: - group: pr-agent-${{ github.event.pull_request.number || github.event.issue.number }} + group: pr-agent-${{ github.event.pull_request.number || github.event.issue.number }}-${{ github.event_name }} cancel-in-progress: true permissions: