-
Notifications
You must be signed in to change notification settings - Fork 0
fix(opencode-review): drop head-SHA concurrency scoping, structurally close #1568 instead #1781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,31 +10,53 @@ on: | |
| # isolated in opencode-review-dispatch.yml on repository_dispatch only. | ||
| pull_request_target: | ||
| # `converted_to_draft` is included so a PR going draft mid-poll fires a | ||
| # fresh run of this same workflow: the head-scoped concurrency group below | ||
| # (`cancel-in-progress: true`) cancels any in-flight non-draft | ||
| # "Fail closed without a current-head OpenCode verdict" poll for that | ||
| # exact same head. Every non-closed admission path revalidates the live | ||
| # PR/head/state before dispatching, exempting, or polling so out-of-order | ||
| # draft/ready/closed events cannot publish stale evidence or wait on an | ||
| # impossible verdict. | ||
| # fresh run of this same workflow. That new run does NOT cancel the old | ||
| # one (see the concurrency block below): the in-flight "Fail closed | ||
| # without a current-head OpenCode verdict" poll for the prior state | ||
| # instead notices the live draft flag itself on its own next iteration | ||
| # and self-exits within one poll_interval_seconds. Every non-closed | ||
| # admission path revalidates the live PR/head/state before dispatching, | ||
| # exempting, or polling so out-of-order draft/ready/closed events cannot | ||
| # publish stale evidence or wait on an impossible verdict. | ||
| types: [opened, synchronize, reopened, ready_for_review, converted_to_draft, closed] | ||
|
|
||
| concurrency: | ||
| # Scoped by exact head SHA (not just PR number) so a delayed, out-of-order | ||
| # run for an older head cannot cancel the authoritative run already active | ||
| # for a newer head -- GitHub cancels whichever run is currently active in | ||
| # the group when a new one starts, with no notion of "older"/"newer", so | ||
| # sharing a group across different heads let a stale event retire the | ||
| # current head's still-valid run before its own live-head check could ever | ||
| # reject it (Devin Review on `#1568`). Same-head events (draft<->ready | ||
| # transitions, a synchronize retry) still share one group, so | ||
| # `converted_to_draft` still cancels an active same-head verdict poll. | ||
| # Scoped by repository + PR number ONLY (not head SHA) with | ||
| # cancel-in-progress: false -- by explicit user directive on 2026-09-03, | ||
| # refined after review from two peer sessions to fully close the race this | ||
| # is actually protecting against, not just trade one failure mode for | ||
| # another. | ||
| # | ||
| # History: head-SHA scoping was added for Devin Review's `#1568` finding -- | ||
| # GitHub cancels whichever run is currently active in a concurrency group | ||
| # when a new one starts, with no notion of "older"/"newer", so a delayed, | ||
| # out-of-order run for an older head could cancel the authoritative run | ||
| # already active for a newer head. Scoping by head SHA gave each push its | ||
| # own group so this couldn't happen -- but it also meant rapid successive | ||
| # pushes to the SAME PR no longer shared a group at all, so they stopped | ||
| # cancelling each other's in-flight runs and instead queued up | ||
| # independently, directly worsening the self-inflicted queue-thrashing | ||
| # pattern this org measured directly (236/300 cancelled runs attributed to | ||
| # concurrent push volume; see internal memory | ||
| # project_queue_thrashing_self_inflicted_2026_09_03). | ||
| # | ||
| # The actual fix is not to re-key the group but to stop cancelling within | ||
| # it: with cancel-in-progress: false, a late-arriving run for an older head | ||
| # never preempts whichever run is already active, at any arrival order -- | ||
| # the #1568 race is structurally impossible here, not just less likely. | ||
| # The now-queued older-head run still gets a turn once the active run | ||
| # finishes, but by then the poll step's own live-head/live-state | ||
| # revalidation (re-run every iteration, already required for correctness | ||
| # regardless of this setting) sees the head has moved and self-exits within | ||
| # one poll_interval_seconds instead of running to completion or publishing | ||
| # stale evidence. Plain repo+PR-number scoping also means rapid pushes | ||
| # naturally serialize through one queue instead of spawning N independent | ||
| # per-head groups, which is what actually bounds queue depth here. | ||
| group: >- | ||
| opencode-review-bootstrap-${{ | ||
| github.event.pull_request.base.repo.full_name || github.repository }}-${{ | ||
| github.event.pull_request.number || github.run_id }}-${{ | ||
| github.event.pull_request.head.sha || github.run_id }} | ||
| cancel-in-progress: true | ||
| github.event.pull_request.number || github.run_id }} | ||
| cancel-in-progress: false | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Pending current-head review eviction When a current-head run is pending, a later stale event under Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback. |
||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 Concurrency rationale lacks durable evidence
The queue-depth rationale conflicts with the repository's documented single-pending behavior. It also cites private memory, violating the durable-knowledge convention. Preserve the evidence publicly and revise the explanation.
Was this helpful? React with 👍 or 👎 to provide feedback.