Post

Cancel superseded Codex review status runs on a lightweight runner

Cancel superseded Codex review status runs on a lightweight runner

I moved the required Codex review status publisher onto a lightweight GitHub runner and enabled concurrency cancellation for the same pull request. Because each run reads the current head commit and trusted review receipt straight from GitHub, an older in-flight run has nothing unique to publish, so cancelling it saves runner minutes without weakening the gate.

Publisher concurrency flips from queueing to superseding

In the codex-review-gate workflow the job now targets the lightweight runner label instead of the full standard image, and the concurrency group changed from leaving runs in progress to cancelling them. I left a comment in the workflow explaining the tradeoff: every invocation resolves the current head and review receipt from GitHub, so the newest run always supersedes whatever an older one would have reported. The status that consumers see is therefore a function of current state rather than of run order.

Why cancellation is safe for a status gate

Cancellation is only sound because the job is idempotent with respect to input. It does not accumulate results across runs or carry state between attempts, so a cancelled run cannot leave a stale success or failure behind — the replacement run recomputes the same verdict from freshly read head and receipt data. This is the distinction I care about: a queue of pending runs is useful when later runs depend on earlier ones, and wasteful when they do not.

Documentation and static-check pins kept in step

I updated docs/ci-cd.md and openwiki/operations/validation-gates.md to describe the lightweight runner and the cancellation behaviour, including a pointer from the validation-gates page back to the CI/CD security model. The offline static-check script also saw a one-line adjustment alongside the workflow edit, which is what I expect when a workflow file that is pinned by hash changes. These are merged source and documentation changes; I have not yet observed a full pull request cycle through the new runner and concurrency settings. The next check is to watch a pull request with rapid successive pushes and confirm the cancelled run reports as superseded while the final status reflects the latest head.

The pattern for platform teams running review bots

Any team that gates merges on a bot-posted status can apply the same reasoning. Before enabling cancellation, confirm the publisher reads authoritative state on each invocation rather than chaining from a prior result, then move it to the smallest runner that can perform the API calls. The payoff is largest on busy repositories where reviewers push fixes repeatedly, since each superseded run would otherwise occupy a runner to publish a verdict that is already out of date.

This post is licensed under CC BY 4.0 by the author.