From d257d3e5a572635e1c38432ddd501c68f42ae960 Mon Sep 17 00:00:00 2001 From: Drewry Pope Date: Sun, 22 Nov 2026 20:04:53 -0600 Subject: [PATCH] fix(opencode-claimant): raise poll gate timeout 30s -> 300s so live fires pass the gate poll.py's end-to-end latency (sequential turso ledger reads + broker queries + the growing OpenCode session store) measures 55-100s wall with ~2s CPU, permanently above claimant.py's hard-coded 30s gate timeout. Every live fire failed closed as gate_unknown and launched nothing, with a real candidate (task 20708) waiting unbound and cap_room=36 (#13112). Regression note: the timeout side moved, not the poll side. 300s covers the aggregate of poll.py's per-call timeouts (15s server GET, 30s broker POSTs) plus session-store growth, ~3x margin over the observed ~100s worst case. Fail-closed behavior is unchanged: a poll that exceeds 300s or exits non-zero still ends the fire as gate_unknown. The single-instance lock keeps overlapping fires impossible, so a slow poll only delays a fire; it cannot double-launch. Reducing poll.py's own latency (parallelizing its independent reads) remains a separate follow-up. Cherry-picked from the parked, never-pushed commit 8e472164d4cf (branch parked/opencode-claimant-poll-timeout-20261122 in the laptop primary), left unlanded by its author; landed here via worktree + PR for the #13112 acceptance. --- pm-stack/opencode-claimant/claimant.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pm-stack/opencode-claimant/claimant.py b/pm-stack/opencode-claimant/claimant.py index 458fe3bb25..271ace0585 100755 --- a/pm-stack/opencode-claimant/claimant.py +++ b/pm-stack/opencode-claimant/claimant.py @@ -387,13 +387,20 @@ def run_poll() -> Dict[str, Any]: if not poll_script.exists(): raise FileNotFoundError(f"poll.py not found at {poll_script}") - # Run poll.py from the primary clone + # Run poll.py from the primary clone. The 300s ceiling covers the + # aggregate of poll.py's per-call timeouts (15s server GET, 30s broker + # POSTs) plus the growing OpenCode session store (28k+ root sessions + # made the full poll take ~51s on 2026-11-22, permanently above the + # old 30s cap, so every live fire failed its own gate as + # "gate_unknown" -- #3026 fire log 2026-11-23T01:48Z/01:53Z). + # Single-instance lock keeps overlapping fires impossible; a slow poll + # only delays the fire, it cannot double-launch. result = subprocess.run( ["python3", str(poll_script)], cwd=str(PRIMARY_CLONE), capture_output=True, text=True, - timeout=30, + timeout=300, ) if result.returncode != 0: