You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
opencode-claimant(claimant.py): no single-instance lock or bounded pool — a live fire overlapped another fire 11 s apart #8039
The claimant packet and the deployed claimant.py disagree about concurrency control:
Packet: "claimant.py launches distinct candidates in parallel under a bounded pool and a single-instance lock".
Deployed pm-stack/opencode-claimant/claimant.py at origin/main9fbddc76c6: a sequential for candidate in unbound_opencode: loop, no file lock, no pool (grep -n 'flock\|lock\|ThreadPool\|max_workers' → nothing). ~/.local/state/opencode-claimant/claimant.lock exists on disk and is never used by the code.
Evidence from the 2026-11-09T12:22Z fire (live)
~/.local/state/opencode-claimant/fires.jsonl, five consecutive fires in six minutes from more than one entry point:
line
timestamp (UTC)
cap_room
launched
wrapper fire-run-live-*.out present
423
2026-11-09T12:16:53Z
0
0
yes (12:16:51)
424
2026-11-09T12:17:51Z
0
0
no
425
2026-11-09T12:20:39Z
0
0
no
426
2026-11-09T12:22:28Z
0
0
yes (12:22:26, this fire)
427
2026-11-09T12:22:39Z
0
0
no
Line 426 and line 427 are 11 s apart: two invocations overlapped. The entries with no wrapper output are ad-hoc session runs of the same script; the ones with output are the */10-minute OpenChamber scheduled task (f1b4a33b-14d5-4a69-9ad6-d221e42e3ac9).
Why it matters
cap_step() computes cap_room = 36 - active_roots once, and launch_step() then decrements its own local copy. Two overlapping fires each start from the same cap_room; the atomic bind keeps the same task from being double-bound, but nothing stops two fires from spending the same free slots (active roots above 36 — the exact condition the cap exists to prevent) or from racing one candidate, where the loser wastes a create→bind-fail→delete cycle (the recurring bind_failed skips already seen in lines 420/421).
Both overlapping fires saw cap_room 0 this time, so nothing was harmed. A 47 s launching fire (line 421) overlaps a scheduled fire easily.
Proposal
flock (LOCK_EX|LOCK_NB) on ~/.local/state/opencode-claimant/claimant.lock around the whole fire; a second fire exits early with a distinguishable fire-log reason (already_running), not no_candidates.
Either a bounded ThreadPoolExecutor as the packet describes, or — simpler and matching the observed wave behaviour — keep the sequential loop and record the packet change. Whichever lands, packet and code must state the same thing.
Two live fires overlapped 3 s apart. Both found zero unbound candidates (skips: [{"reason": "no_candidates"}]), so no session was created and there was no double-launch — the overlap is benign only because the gate was empty. grep -n 'flock\|fcntl\|claimant.lock' pm-stack/opencode-claimant/claimant.py still returns nothing, and the 0-byte ~/.local/state/opencode-claimant/claimant.lock is still unused: the lock gap itself is unchanged.
Worth noting for whoever picks this up: a concurrent pair that does find candidates is bounded against duplicate work by the atomic DB bind (the loser's bind errors and it must not prompt), but it is not bounded against leaked unbound sessions — each fire creates its session before binding, and the loser leaves one behind. The single-instance lock is still the correct fix.
[agent: repo-worker-code / lane code-a, task 18575] Triage of #8039: CONFIRMED live, fix routed as queue task 20061.
Fresh checks (2026-11-17): issue OPEN (bug, kind/bug, pm-stack; no hold labels). Current main pm-stack/opencode-claimant/claimant.py (1017 lines) still contains no flock/fcntl/claimant.lock/ThreadPool code — the packet/code disagreement is exactly as filed, and the 2026-11-16 recurrence comment (two live fires 3 s apart, benign only because the candidate gate was empty) still describes the present state.
The issue's own proposal is the fix scope, unchanged: flock (LOCK_EX|LOCK_NB) on the existing ~/.local/state/opencode-claimant/claimant.lock around the whole fire with an already_running fire-log reason; keep the sequential loop and align the packet wording (or implement the bounded pool — packet and code must agree); pass the candidate list to log_fire so candidates_seen is real (#7732). Task 20061 carries that scope with an overlap-refusal acceptance check.
Activity
developing-today commentedon Nov 9, 2026
CODE-2373
dezren39 commentedon Nov 16, 2026
Recurrence evidence (2026-11-16, live mode, OpenChamber scheduled invocation):
13:17:11Z—claimant-fire-exec-20261116T131711Z.out(another entry point)13:17:14Z—claimant-fire-exec-session-20261116T131714Z.out(this fire)Two live fires overlapped 3 s apart. Both found zero unbound candidates (
skips: [{"reason": "no_candidates"}]), so no session was created and there was no double-launch — the overlap is benign only because the gate was empty.grep -n 'flock\|fcntl\|claimant.lock' pm-stack/opencode-claimant/claimant.pystill returns nothing, and the 0-byte~/.local/state/opencode-claimant/claimant.lockis still unused: the lock gap itself is unchanged.Worth noting for whoever picks this up: a concurrent pair that does find candidates is bounded against duplicate work by the atomic DB bind (the loser's bind errors and it must not prompt), but it is not bounded against leaked unbound sessions — each fire creates its session before binding, and the loser leaves one behind. The single-instance lock is still the correct fix.
dezren39 commentedon Nov 17, 2026
[agent: repo-worker-code / lane code-a, task 18575] Triage of #8039: CONFIRMED live, fix routed as queue task 20061.
Fresh checks (2026-11-17): issue OPEN (bug, kind/bug, pm-stack; no hold labels). Current main
pm-stack/opencode-claimant/claimant.py(1017 lines) still contains no flock/fcntl/claimant.lock/ThreadPool code — the packet/code disagreement is exactly as filed, and the 2026-11-16 recurrence comment (two live fires 3 s apart, benign only because the candidate gate was empty) still describes the present state.The issue's own proposal is the fix scope, unchanged: flock (LOCK_EX|LOCK_NB) on the existing
~/.local/state/opencode-claimant/claimant.lockaround the whole fire with analready_runningfire-log reason; keep the sequential loop and align the packet wording (or implement the bounded pool — packet and code must agree); pass the candidate list tolog_firesocandidates_seenis real (#7732). Task 20061 carries that scope with an overlap-refusal acceptance check.Merge pull request #11433 from developing-today/fix/8039-claimant-sin…