Stop @claude review from cancelling itself - #5
Merged
Conversation
Claude's progress comment fires issue_comment a second time - it's posted with the Claude App's installation token, and GitHub only suppresses re-triggering for a workflow's own GITHUB_TOKEN. Because concurrency is evaluated at run level, before the job's if:, that second run joined the same per-PR group and cancel-in-progress killed the real review ~30s in, before the job guard ever got to skip it. Observed on Duatic/duatic_duarover_autonomy#43: run 31023403141 cancelled at 16:04:28, 36s after starting, by the skipped run 31023440710. Only genuine requests now share the per-PR concurrency group; anything else keys on the unique run id, so it cannot cancel a review in flight. Two real requests on one PR still supersede each other. Also reject Bot comment authors in the job guard, which forecloses a loop if Claude ever opens a comment with the trigger phrase.
Passing github_token short-circuits the action's OIDC-to-App-token exchange (src/github/token.ts returns OVERRIDE_GITHUB_TOKEN immediately), so Claude's progress comment is made with the workflow's own GITHUB_TOKEN. GitHub does not re-trigger workflows for events caused by GITHUB_TOKEN, so that comment no longer starts a second run of this workflow on every review. Reviews now post as github-actions[bot] instead of claude[bot], which is the whole cost of the change. The concurrency hardening stays, and is not redundant: issue_comment fires for every comment on a PR, so an unrelated comment during a review still starts a run, and concurrency is evaluated before the job's if:. Keyed on the PR alone, a colleague posting 'LGTM' mid-review would cancel it.
Passing GITHUB_TOKEN removed one skipped run per review, but skipped runs appear regardless - issue_comment fires for every comment on a PR and cannot filter on text - so it bought little. The costs were real: reviews would post as github-actions[bot], and a future fix mode's commits would not trigger CI, since GitHub suppresses workflow runs for commits made with GITHUB_TOKEN. The concurrency fix is what actually stops the self-cancellation, and it covers Claude's progress comment and unrelated PR comments alike.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@claude reviewhas never actually completed: it starts, then kills itself ~30s in. First observed on Duatic/duatic_duarover_autonomy#43.What happens
mbloechlicomments@claude review31023403141created (actormbloechli), job starts 16:03:37claude[bot]posts its "Reviewing PR #43" progress comment31023440710created (actorclaude[bot]), job correctly skipped31023403141cancelledFix
Filter for new comments, that aren't calling the workflow to be executed before checking for concurrency