swarm: multi-host race lets two workers both land a ticket — winner merges, loser's PR orphans and the ticket dead-ends agent-blocked #1534

Closed
opened 2026-09-16 04:50:29 +00:00 by cherese · 1 comment
Owner

What happened

On Matou/pregnancy-navigator, two tickets (#28, #18) were independently claimed and completed by two different hosts each, in the same swarm run (run 174, 2026-09-16 ~03:52–04:45 UTC). In both cases:

  1. Host A and Host B both pick up the same ticket via the multi-host claim (swarm-claim comment — "lowest live claim id works this ticket").
  2. Both do the work and open their own PR.
  3. One PR merges first (winner). The other PR's CI still runs to green independently, but by the time its close-report checks in, its commit is no longer the head of an open PR for that issue.
  4. The loser's close-report correctly detects this ("no open agent PR for this issue") and refuses to close — but there's no path from there back to "reconcile against the PR that actually won." The ticket is left labeled agent-blocked even though the work is done and already on main.

Concrete repro (this run)

#28 (apps/web ESLint):

  • Winner: PR #30, merged, went green, closed #28's acceptance criteria.
  • Loser: PR #32 (agent/issue-28, commit 59b060c) — CI went green independently at 04:41, then got closed unmerged at 04:42 once #30 was already on main.
  • Result: #28 now carries agent-blocked; its close-report comment (04:42:46) states "Work is complete and merged — but the close-report gate cannot run (mis-landed vehicle)" and has to explain the situation in prose rather than the gate handling it.

#18 (safety-critical routing):

  • Winner: PR #31 (sandcastle/worker/20260915-225231-f5a520), merged.
  • Loser: PR #33 (agent/issue-18, commit 102973f) — still open, CI went green at 04:45 for a change now redundant.
  • Result: #18 shows both ready-for-agent and agent-working simultaneously — looks like it got re-triaged as available while a worker (the loser) still nominally holds it.

Why it matters

  • Wastes a full CI run + worker cycle on the loser every time this race fires.
  • Leaves tickets stuck in agent-blocked for work that's actually done, requiring a human to notice and manually reconcile/close — defeats the point of the close-report gate.
  • Produces confusing label states (ready-for-agent + agent-working together) that a human monitoring the board can't trust at a glance.
  • Related prior art on claim races: idss #1412 (dead peer session's claim blocks a ticket forever) was fixed; this is the opposite failure mode of the same claim system — completed-twice, not completed-never.

Possible directions (not prescribing a fix)

  • Loser's close-report, on detecting "no open PR for this issue," could check whether the issue is already closed/merged via a different PR and self-close as superseded instead of dead-ending in agent-blocked.
  • Or: once a ticket's acceptance criteria land via any PR, immediately close/abandon any other open PR referencing the same issue number, so a straggler CI run doesn't complete against dead work.

Evidence

  • Matou/pregnancy-navigator issues #28, #18
  • PRs #30 (merged, winner for #28), #32 (orphaned loser for #28), #31 (merged, winner for #18), #33 (orphaned loser for #18)
  • Swarm run 174, .forgejo/workflows/swarm.yml claim comments ("lowest live claim id works this ticket")
## What happened On `Matou/pregnancy-navigator`, two tickets (#28, #18) were independently claimed and completed by two different hosts each, in the same swarm run (run 174, 2026-09-16 ~03:52–04:45 UTC). In both cases: 1. Host A and Host B both pick up the same ticket via the multi-host claim (`swarm-claim` comment — "lowest live claim id works this ticket"). 2. Both do the work and open their own PR. 3. One PR merges first (winner). The other PR's CI still runs to green independently, but by the time its close-report checks in, its commit is no longer the head of an open PR for that issue. 4. The loser's close-report correctly detects this ("no open agent PR for this issue") and refuses to close — but there's no path from there back to "reconcile against the PR that actually won." The ticket is left labeled `agent-blocked` even though the work is done and already on `main`. ## Concrete repro (this run) **#28** (`apps/web` ESLint): - Winner: PR #30, merged, went green, closed #28's acceptance criteria. - Loser: PR #32 (`agent/issue-28`, commit `59b060c`) — CI went green independently at 04:41, then got closed unmerged at 04:42 once #30 was already on `main`. - Result: #28 now carries `agent-blocked`; its close-report comment (04:42:46) states *"Work is complete and merged — but the close-report gate cannot run (mis-landed vehicle)"* and has to explain the situation in prose rather than the gate handling it. **#18** (safety-critical routing): - Winner: PR #31 (`sandcastle/worker/20260915-225231-f5a520`), merged. - Loser: PR #33 (`agent/issue-18`, commit `102973f`) — still open, CI went green at 04:45 for a change now redundant. - Result: #18 shows both `ready-for-agent` and `agent-working` simultaneously — looks like it got re-triaged as available while a worker (the loser) still nominally holds it. ## Why it matters - Wastes a full CI run + worker cycle on the loser every time this race fires. - Leaves tickets stuck in `agent-blocked` for work that's actually done, requiring a human to notice and manually reconcile/close — defeats the point of the close-report gate. - Produces confusing label states (`ready-for-agent` + `agent-working` together) that a human monitoring the board can't trust at a glance. - Related prior art on claim races: idss #1412 (dead peer session's claim blocks a ticket forever) was fixed; this is the opposite failure mode of the same claim system — completed-twice, not completed-never. ## Possible directions (not prescribing a fix) - Loser's close-report, on detecting "no open PR for this issue," could check whether the issue is already closed/merged via a *different* PR and self-close as superseded instead of dead-ending in `agent-blocked`. - Or: once a ticket's acceptance criteria land via any PR, immediately close/abandon any other open PR referencing the same issue number, so a straggler CI run doesn't complete against dead work. ## Evidence - `Matou/pregnancy-navigator` issues #28, #18 - PRs #30 (merged, winner for #28), #32 (orphaned loser for #28), #31 (merged, winner for #18), #33 (orphaned loser for #18) - Swarm run 174, `.forgejo/workflows/swarm.yml` claim comments ("lowest live claim id works this ticket")
Author
Owner

Filed this on the wrong repo -- idss is a product repo built on the dev-factory harness, not the harness repo itself. Moved to the correct repo: Matou/dev-factory#151. Closing this one.

Filed this on the wrong repo -- idss is a product repo built on the dev-factory harness, not the harness repo itself. Moved to the correct repo: Matou/dev-factory#151. Closing this one.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#1534
No description provided.