From 05aab5771f2b834fdcf1e3267751f6d834b6d0e3 Mon Sep 17 00:00:00 2001 From: Seongho Bae Date: Thu, 3 Sep 2026 15:10:27 +0900 Subject: [PATCH] docs(opencode-review): fix stale comment describing the pre-#1781 design Flagged by host 1 (relayed via peer 1): cancel-superseded-opencode-review-runs' own comment still described "exact-head concurrency" protecting the newer run -- that mechanism was removed in #1781 (bootstrap group is now cancel-in-progress: false, scoped by repo+PR-number only). While fixing it, found this job's actual role is more significant than its old "defense in depth" framing suggested: it's a precise, live-head- reverified, API-based sweep that already implements "cancel only outdated runs of the same PR" (re-checks the live head immediately before selecting cancellation candidates AND immediately before every individual cancel call), so it's immune to #1568's order-blind-preemption bug by construction. Now that the bootstrap group no longer auto-cancels anything natively, this job is the primary active-cancellation path, not a backup. Rewrote the comment to say so. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/opencode-review.yml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/opencode-review.yml b/.github/workflows/opencode-review.yml index 565d63ab62..e7a47d12e4 100644 --- a/.github/workflows/opencode-review.yml +++ b/.github/workflows/opencode-review.yml @@ -549,15 +549,21 @@ jobs: echo "Current-head OpenCode verdict: ${verdict}." cancel-superseded-opencode-review-runs: - # Exact-head concurrency protects a newer authoritative run from delayed - # old-head events, while the poll above now revalidates live PR identity on - # every wait iteration so an already-running obsolete poll can self-retire - # without consuming a second runner. This sibling job remains a defense in - # depth for queued/requested old-head runs and for legacy runs created from - # older workflow revisions that lack the in-loop self-retirement check. - # Every cancellation candidate and every cancellation itself is re-verified - # against the live PR head immediately beforehand, so a cleanup run that is - # itself delayed/stale cannot cancel a still-authoritative run. + # This job -- not the bootstrap concurrency group above -- is the primary + # mechanism that actively cancels a same-PR run for an outdated head. The + # bootstrap group is now `cancel-in-progress: false` (see its own comment): + # nothing is ever preempted there, by design, to structurally close the + # #1568 stale-cancels-fresh race regardless of arrival order. This job + # achieves precise, safe "cancel only outdated runs of the same PR" + # instead: it re-verifies the live PR head immediately before selecting + # candidates AND immediately before every individual cancellation call, so + # a cleanup run that is itself delayed/stale cannot cancel a + # still-authoritative run, and it only ever targets runs whose recorded + # head no longer matches the live one. The poll step above also + # revalidates live PR identity on every wait iteration as a second, + # independent line of defense, so an already-running obsolete poll + # self-retires even if this cleanup job's own run for that event is + # delayed or fails. if: github.event_name == 'pull_request_target' && github.event.action == 'synchronize' runs-on: ubuntu-24.04 permissions: