Skip to content

fix(ci): claude-pr-review self-cancels via bot status comment#440

Merged
avihut merged 1 commit intomasterfrom
daft-439/fix-review-self-cancel
May 1, 2026
Merged

fix(ci): claude-pr-review self-cancels via bot status comment#440
avihut merged 1 commit intomasterfrom
daft-439/fix-review-self-cancel

Conversation

@avihut
Copy link
Copy Markdown
Owner

@avihut avihut commented May 1, 2026

Summary

Move the `concurrency` block on `.github/workflows/claude-pr-review.yml` from workflow level to the `review` job level so that bot status comments don't cancel the running review.

What was happening

  1. Maintainer comments `/claude review` on a PR. Run Feature: Shorthand Remote URL Support #1 fires, action starts.
  2. `claude[bot]` posts a "Claude Code is working..." status comment.
  3. That comment is an `issue_comment` `created` event on the same PR. Workflow run Feature: Root Level .git Dir #2 is queued with the same concurrency-group key.
  4. `concurrency.cancel-in-progress: true` at the workflow level cancels run Feature: Shorthand Remote URL Support #1 before any `if:` is evaluated.
  5. Run Feature: Root Level .git Dir #2 then evaluates `if:` — comment doesn't match `/claude review` — and skips.

Net: the action's own progress comment cancels the action.

Reproduced on PR #438, run `25225661590` cancelled at 17:48:43Z by the bot comment posted at 17:48:26Z.

Why job-level concurrency fixes it

GitHub evaluates a job's `if:` filter before applying its job-level concurrency rule. A skipped job does not occupy the concurrency slot. So the bot's status comment continues to fire `issue_comment` events, but those events are skipped by `if:` and never reach the cancel-in-progress logic. Only events that actually pass `/claude review` + OWNER will queue (and cancel) a real review run.

Test plan

  • Merge this PR.
  • Open a throwaway PR with a real-code change.
  • Comment `/claude review`. Confirm the workflow run completes (does not cancel mid-flight).
  • Confirm Claude posts a review comment referencing the PR's actual diff.
  • As a sanity check, comment something unrelated on the same PR while the review is running. Confirm the running review continues.

Fixes #439

The claude-code-action posts a "Claude Code is working..." status
comment shortly after starting. That comment is itself an issue_comment
created event on the same PR, which queued a second workflow run with
the same concurrency group key.

With concurrency at the workflow level and cancel-in-progress: true,
the new run cancels the in-progress run *before* any if: is evaluated
-- so the running review was killed by the action's own status comment.
The second run then evaluated if: against "Claude Code is working..."
and skipped, but the damage was done.

Move the concurrency block onto the review job itself. GitHub evaluates
job-level if: before applying job-level concurrency, so a skipped job
does not occupy the slot or cancel siblings.

Manifested in run 25225661590, cancelled at 17:48:43Z by the bot
comment posted at 17:48:26Z on PR #438.

Fixes #439
@avihut avihut added this to the Public Launch milestone May 1, 2026
@avihut avihut added the ci CI/CD changes label May 1, 2026
@avihut avihut self-assigned this May 1, 2026
@avihut avihut merged commit 38b5a73 into master May 1, 2026
10 checks passed
@avihut avihut deleted the daft-439/fix-review-self-cancel branch May 1, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI/CD changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ci): claude-pr-review self-cancels via bot status comment

1 participant