We raised $3M for agent-native runners

Cancel superseded pull request runs

Free runner capacity by canceling validation that a newer commit has replaced. Keep required main-branch and release runs intact.

How it works

Group validation runs by the pull request or branch they validate. When a newer commit starts another run in that group, cancel the older validation. Scope the cancellation rule to work that the new run replaces; deployment, release and migration workflows need their own completion rules.

How companies used this technique

Read what each company changed and follow the original sources.

Cancel superseded runs, never on main

Anthropic's Python and TypeScript SDKs added a workflow concurrency group keyed on the branch, so a newer push cancels the older run. On main the group is keyed on the commit, so main runs never cancel each other.

Use it when
Developers or agents push to the same branch several times while CI is still running.
Before applying it
Deploy, publish and migration workflows keep running to completion; only runs whose result a newer commit replaces are cancelled.

Cancel obsolete runs using the correct event identity

Mastra added workflow concurrency and cancellation to lint, docs and workspace workflows. Related changes handled workflow_run identity and separated comment-driven approval updates from PR updates.

Use it when
Repeated pushes leave obsolete verification jobs occupying runners.
Before applying it
Key the group on workflow plus the logical PR or ref, with safe fallbacks, so a new commit cancels the old run. Keep release and destructive side-effect jobs out of indiscriminate cancellation.

Cancel superseded pull request runs

Stripe iOS added a concurrency group to its dead-code workflow, keyed by pull request number, with cancel-in-progress so a new push stops the previous scan.

Use it when
Superseded pull request runs keep consuming runners.
Before applying it
Scope cancellation to replaceable pull request validation. Releases, deployments, migrations and default-branch runs that must finish keep cancel-in-progress off.

Cancel superseded pull request runs

Base Web added a concurrency group keyed on the workflow and pull request number to its PR Check workflow, with cancel-in-progress, so a new push stops the run it supersedes. NilAway did the same for its Golden Test workflow.

Use it when
Developers push several commits to a pull request in quick succession and each push starts a full run.
Before applying it
Key the group on the pull request so runs for different pull requests never cancel each other, and keep default-branch and release runs out of cancel-in-progress.

Company Playbooks