ci: allow the bot actor, and stop push runs cancelling their own handoff - #149
Merged
Conversation
Found by a deliberate end-to-end canary (PR #148 against a throwaway base branch), which exercised push -> detect -> handoff -> repository_dispatch -> resolve for the first time. BUG 1 (blocker): claude-code-action refuses non-human actors — "Workflow initiated by non-human actor: github-actions (type: Bot). Add bot to allowed_bots list". The handoff added in #146 fires repository_dispatch with GITHUB_TOKEN, so every handed-off run was attributed to github-actions[bot] and died at the AI step. This meant the automatic push path NEVER worked end to end; the only runs that ever reached the model were workflow_dispatch runs a human triggered, which is exactly why it looked healthy. Fixed with allowed_bots: github-actions (deliberately not '*'). BUG 2 (race): the push run and the repository_dispatch it spawns shared a concurrency group with cancel-in-progress, so the child cancelled its parent mid-handoff (observed: 'handoff: cancelled'). It only worked because the dispatch API call had already returned — had cancellation landed first, the handoff would have been lost silently. Push/PR/resolution runs now occupy separate concurrency namespaces. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Found by a deliberate canary
Built a throwaway conflict (PR #148 against a scratch base branch) to exercise
push → detect → handoff → repository_dispatch → resolveend to end for the first time. It immediately surfaced two bugs — including one that meant the automatic path had never actually worked.Bug 1 (blocker): the handoff was rejected as a bot
claude-code-actionrefuses non-human actors by default. The handoff added in #146 firesrepository_dispatchusingGITHUB_TOKEN, so every handed-off run is attributed togithub-actions[bot]and died at the AI step.This meant the automatic push path never worked end to end. Every run that ever reached the model — #145, #119, #126 — was a
workflow_dispatchI triggered as a human, which is exactly why it looked healthy. The canary was the first bot-initiated run.Fixed with
allowed_bots: "github-actions"— deliberately naming the one bot rather than'*'.Bug 2 (race): the push run cancelled its own handoff
Observed
handoff: cancelledon the canary. The push run and therepository_dispatchit spawns shared a concurrency group withcancel-in-progress: true, so the child cancelled its parent mid-handoff.It only worked because the dispatch API call had already returned. Had cancellation landed a moment earlier, the handoff would have been lost with no error — a silent, timing-dependent no-op, the worst kind of bug to chase later.
Push / PR / resolution runs now occupy separate concurrency namespaces (
resolve-detect-*,resolve-pr*,resolve-base-*).Validation
YAML parses;
allowed_botsand the three-way concurrency expression verified in the parsed output. The canary (#148) is still conflicting and will be re-run against this branch to confirm the chain completes.🤖 Generated with Claude Code