From 120aca466d646ee1c770b2712a0d2742d5dd62d6 Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Tue, 13 Jan 2026 13:41:30 -0500 Subject: [PATCH] fix(ci): prevent self-cancelling AI review workflow Root cause: Bot progress comments triggered issue_comment events, which created new workflow runs with the same concurrency group, causing cancel-in-progress to kill the original review. Fixes: 1. Add event_name to concurrency group (prevents cross-event cancellation) 2. Explicit filter for ccs-agy-reviewer[bot] comments (belt-and-suspenders) Closes race condition causing 25+ cancelled AI review runs. --- .github/workflows/ai-review.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ai-review.yml b/.github/workflows/ai-review.yml index 9e0a7f53..cb017413 100644 --- a/.github/workflows/ai-review.yml +++ b/.github/workflows/ai-review.yml @@ -21,9 +21,10 @@ on: required: true type: string -# Cancel in-progress runs for same PR (safe now since auto-trigger is only on opened) +# Cancel in-progress runs for same PR + event type (prevents self-cancellation from bot comments) +# Each event type gets its own concurrency group to prevent cross-event cancellation concurrency: - group: ai-review-${{ github.event.pull_request.number || github.event.issue.number || github.event.inputs.pr_number }} + group: ai-review-${{ github.event_name }}-${{ github.event.pull_request.number || github.event.issue.number || github.event.inputs.pr_number }} cancel-in-progress: true jobs: @@ -38,14 +39,16 @@ jobs: # Conditions: # - PR event: only on opened (not synchronize to avoid cancel-on-push) - # - Comment event: only if it's a PR, contains /review, and NOT from a bot + # - Comment event: only if it's a PR, contains /review, NOT from a bot, and NOT from our review bot + # The explicit bot name check prevents self-triggering from progress comments if: > github.event_name == 'pull_request_target' || github.event_name == 'workflow_dispatch' || (github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, '/review') && - github.event.comment.user.type != 'Bot') + github.event.comment.user.type != 'Bot' && + github.event.comment.user.login != 'ccs-agy-reviewer[bot]') # CLIProxy environment for model routing env: