reconcile: a reopened stranded close keeps the dead run's claim, so no session runner can take it for up to 2h05m #366

Closed
opened 2026-11-19 16:16:19 +00:00 by ben · 1 comment
Owner

Being worked now by an interactive session (Claude, with Ben), 2026-11-19. no-triage so nothing else picks it up; the session closes it when the fix is on main.

What happens

When a push-mode close does not land, the #283 reconcile reopens the ticket as ready-for-session, but the finished swarm run's swarm-claim comment stays on it. Every session runner that then picks the ticket posts its own claim, sees the older one, and stands down. The ticket cannot be re-landed until the stale claim is older than the session claim TTL (SESSION_RUNNER_TIMEOUT + slack, 7500 s).

Evidence: this tracker's #359, 2026-11-19 (UTC)

  • 14:15:51: swarm run 28842 on bens-mac-04 posts its claim (comment 74374).
  • 15:11: close-report closes the ticket. 15:13: the land is rolled back (push-parked-on-rescue) and the reconcile reopens it. The claim comment is still there.
  • 15:15, 15:25, 15:35, 15:45 on elitebook-03, and 15:55, 16:05 on bens-mac-04: session-runner: picked #359 then a peer host's claim outranks ours (#125); standing down before the session.
  • The run that owns the claim had ended. The claim stops counting at 16:20:51, two hours and five minutes after it was posted.

Cause

claim_fresh_runs (#1412) rightly treats a claim younger than the TTL as live, because nothing else can tell a dead peer from a live one. But on this path the factory does know: the run doing the reconcile is the run that posted the claim, and it is at its end. landing_reopen_stranded_closes reopens and relabels and leaves the claim as a tombstone. Neither the janitor nor the stale-claim sweep visits a ticket that is no longer agent-working.

Fix

When the reconcile reopens a ticket, delete this run's own swarm claim comments on it (run=$SWARM_RUN_ID, first line with no session-ttl=). Never another run's claim, and never a session claim: a session's run= is a pid and can equal a swarm run number by chance.

Checks

  • Offline test: a stranded close that is reopened has this run's swarm claim comment deleted.
  • Offline test: another run's claim and a session claim with the same number are left alone.
  • Offline test: with no run id, nothing is deleted.
> **Being worked now by an interactive session (Claude, with Ben), 2026-11-19.** `no-triage` so nothing else picks it up; the session closes it when the fix is on `main`. ## What happens When a push-mode close does not land, the #283 reconcile reopens the ticket as `ready-for-session`, but the finished swarm run's `swarm-claim` comment stays on it. Every session runner that then picks the ticket posts its own claim, sees the older one, and stands down. The ticket cannot be re-landed until the stale claim is older than the session claim TTL (`SESSION_RUNNER_TIMEOUT` + slack, 7500 s). ## Evidence: this tracker's #359, 2026-11-19 (UTC) - 14:15:51: swarm run 28842 on `bens-mac-04` posts its claim (comment 74374). - 15:11: close-report closes the ticket. 15:13: the land is rolled back (`push-parked-on-rescue`) and the reconcile reopens it. The claim comment is still there. - 15:15, 15:25, 15:35, 15:45 on `elitebook-03`, and 15:55, 16:05 on `bens-mac-04`: `session-runner: picked #359` then `a peer host's claim outranks ours (#125); standing down before the session`. - The run that owns the claim had ended. The claim stops counting at 16:20:51, two hours and five minutes after it was posted. ## Cause `claim_fresh_runs` (#1412) rightly treats a claim younger than the TTL as live, because nothing else can tell a dead peer from a live one. But on this path the factory does know: the run doing the reconcile is the run that posted the claim, and it is at its end. `landing_reopen_stranded_closes` reopens and relabels and leaves the claim as a tombstone. Neither the janitor nor the stale-claim sweep visits a ticket that is no longer `agent-working`. ## Fix When the reconcile reopens a ticket, delete this run's own swarm claim comments on it (`run=$SWARM_RUN_ID`, first line with no `session-ttl=`). Never another run's claim, and never a session claim: a session's `run=` is a pid and can equal a swarm run number by chance. ## Checks - Offline test: a stranded close that is reopened has this run's swarm claim comment deleted. - Offline test: another run's claim and a session claim with the same number are left alone. - Offline test: with no run id, nothing is deleted.
ben self-assigned this 2026-11-19 16:16:19 +00:00
Author
Owner

Fixed on main in 660f39d (pull request 367), by an interactive session (Claude, with Ben).

  • landing_drop_run_claims in landing-lib.sh, called by the #283 reconcile right after the reopen.
  • Checked: the full offline suite passes; tests/landing-lib-test.sh 181 passed, 9 new; pinned shellcheck v0.11.0 clean on the two changed shell files.
  • Not checked: ci / test and ci / static never ran on the branch. CI has been queued since about 16:20Z for pushes to main as well.
  • Still owed: a pin bump (self-pin and each consumer) before any running copy has the fix.
  • No STATUS.md row: that file is 8 bytes under its budget on main.
Fixed on `main` in `660f39d` ([pull request 367](https://git.matou.nz/Matou/dev-factory/pulls/367)), by an interactive session (Claude, with Ben). - `landing_drop_run_claims` in `landing-lib.sh`, called by the #283 reconcile right after the reopen. - Checked: the full offline suite passes; `tests/landing-lib-test.sh` 181 passed, 9 new; pinned shellcheck v0.11.0 clean on the two changed shell files. - Not checked: `ci / test` and `ci / static` never ran on the branch. CI has been queued since about 16:20Z for pushes to `main` as well. - Still owed: a pin bump (self-pin and each consumer) before any running copy has the fix. - No `STATUS.md` row: that file is 8 bytes under its budget on `main`.
ben closed this issue 2026-11-19 17:41:29 +00:00
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/dev-factory#366
No description provided.