From b37f8489fc9949a2da5bea56693b6a66c177b948 Mon Sep 17 00:00:00 2001 From: Archer Date: Thu, 5 Nov 2026 09:55:22 -0600 Subject: [PATCH] fix(opencode-claimant): cap 20 -> 36 - lane-runner waves still starved the claimant Post-#6268 verification: with cap 20 the claimant remained at cap_room 0 during scheduled lane waves. Measured composition (2026-11-05 09:40-09:54 CST): ~37-39 active roots, overwhelmingly Queue lane (scheduled) runner sessions, at load 0.86-4.34 on 16 cores - root count is a weak load proxy for API-bound agent sessions. 36 sits above the observed wave size so the claimant keeps launch room during waves, while total roots stay within ~2x the census-proven 18-19. Constants aligned across poll.py, claimant.py, prompt.md, README.md; prompt history records why. --- pm-stack/opencode-claimant/README.md | 2 +- pm-stack/opencode-claimant/claimant.py | 4 ++-- pm-stack/opencode-claimant/poll.py | 4 ++-- pm-stack/opencode-claimant/prompt.md | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pm-stack/opencode-claimant/README.md b/pm-stack/opencode-claimant/README.md index 957f517109..9ed613e120 100644 --- a/pm-stack/opencode-claimant/README.md +++ b/pm-stack/opencode-claimant/README.md @@ -25,7 +25,7 @@ worker sessions it launches run on the standing OpenCode server - `poll.py` — read-only candidate discovery the prompt runs each fire: claimed tasks whose `progress.lane` is `opencode` with no bound `session_id` (across the four repo-health queues), plus the live - root-session count for the 20-session cap. It cannot mutate anything. + root-session count for the 36-session cap. It cannot mutate anything. - `install.mjs` — idempotent installer: merges the task definition (stable id `f1b4a33b-14d5-4a69-9ad6-d221e42e3ac9`) into the laptop's code-project OpenChamber store, preserving all other tasks, with a diff --git a/pm-stack/opencode-claimant/claimant.py b/pm-stack/opencode-claimant/claimant.py index d2d3c9a3f8..9dd0baad7c 100755 --- a/pm-stack/opencode-claimant/claimant.py +++ b/pm-stack/opencode-claimant/claimant.py @@ -33,7 +33,7 @@ "repo-health-openchamber-pilot", "repo-health-nix-pilot", ] -CAP = 20 +CAP = 36 ACTIVE_WINDOW_MS = 30 * 60 * 1000 # 30 minutes OPENCODE_URL = os.environ.get("OPENCODE_URL", "http://127.0.0.1:13420") AUTH_FILE = os.environ.get( @@ -311,7 +311,7 @@ def discover_candidates_and_stuck(): "stuck_bound": [...], "live_root_sessions": int | None, "active_root_sessions": int | None, - "cap": 20, + "cap": 36, "cap_room": int | None } """ diff --git a/pm-stack/opencode-claimant/poll.py b/pm-stack/opencode-claimant/poll.py index bd7a4f5cad..695eb28728 100644 --- a/pm-stack/opencode-claimant/poll.py +++ b/pm-stack/opencode-claimant/poll.py @@ -24,7 +24,7 @@ # null = server unreadable "active_root_sessions": int | null, # roots still active # (see is_active_root) - "cap": 20, + "cap": 36, "cap_room": int | null # CAP - active roots; # null when count unknown } @@ -51,7 +51,7 @@ "repo-health-openchamber-pilot", "repo-health-nix-pilot", ] -CAP = 20 +CAP = 36 # A root session counts toward the cap only while it is active: no # terminal marker and recent activity. GET /api/session returns every # finished-but-unarchived session forever (50 roots at the #3026 gate diff --git a/pm-stack/opencode-claimant/prompt.md b/pm-stack/opencode-claimant/prompt.md index 343d7dd47e..99f70d7f52 100644 --- a/pm-stack/opencode-claimant/prompt.md +++ b/pm-stack/opencode-claimant/prompt.md @@ -23,7 +23,7 @@ improvise the steps by hand. Inside a fire, claimant.py launches distinct candidates in parallel under a bounded pool and a single-instance lock; exactly-once stays anchored on the atomic DB bind. (History: the cap was 12 until 2026-11-05, when the -binding-rate fix raised it to 20 to match demonstrated headroom; +binding-rate fix raised it first to 20, then to 36 the same day (at 20, scheduled lane-runner waves of ~39 roots at load ~4/16 cores still left the claimant cap_room 0; 36 sits above the observed wave size while keeping total roots within ~2x the census-proven level); claimant.py itself was committed the same day - before that it existed only as an untracked file in the laptop primary checkout, which is part of why the standing claimant never went live.) @@ -55,7 +55,7 @@ Never claim, bind, launch, or mutate a task in shadow mode. created-but-never-prompted and dead (step 1's recovery rule, #4758). Retain the candidate list from the start of each fire; a task recovered during supervision is eligible on the next fire, not this one. -- Concurrency cap: **20** active root sessions across the fleet. Count +- Concurrency cap: **36** active root sessions across the fleet. Count with poll.py (OpenCode server `GET /api/session` on http://127.0.0.1:13420, root sessions only; poll.py counts a root as active only with no terminal marker — `time.idle`/`outcome` — and @@ -145,7 +145,7 @@ Never claim, bind, launch, or mutate a task in shadow mode. shows 0 claimed-with-lane-opencode unbound candidates (poll.py returns an empty candidate list), end the fire quietly. 3. CAP: if poll.py reports `cap_room` 0 (active root sessions at the - 20 cap) or null (server unreadable), end the fire; record the + 36 cap) or null (server unreadable), end the fire; record the saturation in the fire log (step 6). 4. For each candidate, highest queue priority first, while cap room remains: @@ -248,7 +248,7 @@ queue task and issue>, "model": {"id": , - Never work a task yourself; you claim/bind/launch/record only. - Never launch for a task whose issue carries `held`, `user/owned`, `do-not-merge`, or `do-not-auto-edit` — skip and log it. -- Never exceed the 20-session cap, never double-bind a task, never +- Never exceed the 36-session cap, never double-bind a task, never bind a session id you did not just create. - No credential value ever enters a prompt, log, or task record; the queue CLI and poll.py reach the queue-broker with the broker's client