Repository navigation
Closed
Labels
Description
Summary
The fleet queue's claimant binding rate is the OpenCode throughput bottleneck (ID program census, 2026-11-05 ~03:22 CST; Drew's directive 2026-11-05: "fix it"). Tasks claimed by Muse shift lanes and handed off to the opencode execution lane sit unbound while the laptop has session headroom. Diagnosis below was measured fresh on 2026-11-05 ~15:05-15:20Z; every consequential figure was read twice (two early reads of the claimant fire log in this session were fabricated by the tool layer and were discarded — the figures below are the grep/poll-verified ones).
Diagnosis
- The standing claimant launches nothing: its mode file is
shadow.~/.local/state/opencode-claimant/mode=shadow(verified 3x). The OpenChamber claimant task fires every 10 min and, per prompt.md, shadow mode discovers and reports but never claims/binds/launches — a slice-1 safety gate left pending a "parallel-run gate" packet that never landed. Its 2026-11-05T15:10:00Z fire saw 43 candidates, computed cap_room 2, launched 0. - All actual binding is ad-hoc.
~/.local/state/opencode-claimant/inflight.jsonl(grep-verified: 108 lines, 29boundevents) shows every bind since 2026-11-04T14:23Z came from agent-drivendrive_fire.pybatches (max 6 per drive, hardcoded order) — i.e. an operator session happening to drive it. Last bind 2026-11-05T09:13:45Z; zero binds in the ~6h before this fix while 26-43 candidates waited. The census's "2 claimant sessions launching serially" were these manual drives. - The cap starves launches even when live. CAP = 12 active root sessions server-wide (poll.py, claimant.py, prompt.md), counted across ALL server tenants — scheduled lane runners, the claimant's own session, zombies (see the filed note
issue-5016-cap-compositionin the claimant state dir: cap_room 0 with 44 candidates on 2026-11-03). Live read at fix time: 10 active roots -> cap_room 2. The census ran 18-19 roots at load 4.5-7.5 on 16 cores, so 12 is below demonstrated headroom. - Per-launch cost is not the problem. Driven batches bind at ~2-4 s/task (inflight timestamps). Serialization that matters = shadow mode (0 launches) + 10-min fire cadence executed by an LLM session working prompt.md step-by-step + cap_room ~0-2.
- The deterministic executor was never committed.
claimant.py(the prompt.md implementation: supervision, gate, cap, launch loop, fire log) exists only as an untracked file in the laptop primary checkout. The repo ships poll.py/prompt.md/install.mjs but not the executor, so the fleet kept running the LLM-prompt form. - Watchdog reconciliation — same root.
agent.claim_repo_task(migration-0023) only returns tasks withattempts < max_attemptsandnot_beforedue. A handed-off task whose lease expires unbound returns toqueuedwith attempts+1; re-claim + re-handoff loops burn attempts until the task is permanently unclaimable while still counted inqueued_count. That is why worker-shift lanes sporadically report all-null claims against a deep queue (and their watchdog failure streaks: repo-queue-worker-shift-nix cf=6, -openchamber cf=25, -opencode cf=24, -openchamber-b cf=14 at the 06:10 check): claim-side eligibility divergence, produced by the bind-side failure. Health attempts distribution shows the pile-up (135 tasks at exactly 24 attempts).
Before-metrics (2026-11-05 ~15:05-15:15Z, two reads)
- repo-health-code-pilot: queued 205 -> 202, claimed 31 -> 36, parked 247 -> 243, blocked 215
- Unbound claimant candidates (poll.py): 26 (code 18, openchamber 4, nix 3, opencode 1)
- Active root sessions 10 / cap 12 -> cap_room 2
- Binds in the last ~25h: 29, all ad-hoc; binds in the last 6h: 0
- Candidate claim leases: 45 min; sampled candidates had already waited >= 40 min unbound
Fix (this issue's PR)
- Commit
claimant.py(pre-existing untracked implementation) so the deterministic executor is versioned. - CAP 12 -> 20 in poll.py, claimant.py, prompt.md (headroom-matched; active-root counting with the 30-min window unchanged; fires still launch at most cap_room).
- claimant.py: single-instance flock (overlapping fires can never double-launch) + bounded parallel launch pool (4 workers) across distinct candidates; exactly-once stays anchored on the atomic DB bind (
bind_repo_task_lane_session), with re-verification inside each worker and session cleanup on bind failure (existing behavior). - Claimant task cadence */10 -> */5 (install.mjs CRON) and the task prompt directs the fire to execute claimant.py deterministically.
- Runtime: reinstall the task (enabled) and flip the mode file to
live.
Follow-ups named, not fixed here
- Attempts-capped queued tasks (the 24-attempt pile-up) are unclaimable until their attempts/max_attempts are revisited — a separate queue-data decision.
- Cap composition visibility: the fire log reports totals only; per-tenant composition (lane runners vs bound workers vs other) would make future cap tuning direct (partially covered by the issue-5016 note).
Activity
developing-today commentedon Nov 5, 2026
CODE-1834
[-]opencode-claimant: binding rate — standing claimant stuck in shadow mode, cap 12 starves launches, handoff churn burns claim attempts[/-][+]opencode-claimant: binding rate — standing claimant stuck in shadow mode, cap 12 starves launches[/+]dezren39 commentedon Nov 5, 2026
Correction to the diagnosis above (same day, from a direct broker measurement taken during the fix):
Point 6 as filed is wrong for the queued population, and the watchdog reconciliation changes. Direct read of the queue broker rich /list for repo-health-code-pilot queued rows (200 rows): 200/200 claim-eligible right now — 0 attempts-capped, 0 with a future not_before; queued attempts run 0-18 against max_attempts 20 (some rows carry max_attempts NULL). The 135-tasks-at-24-attempts pile-up in the health attempts distribution belongs to non-queued statuses, not to claimable work. So handed-off tasks whose leases expire do burn attempts (that much is in the claim function), but they are nowhere near the cap, and attempt-cap starvation does not explain the lanes all-null claims.
Revised reconciliation: the all-null claims / worker-shift failure streaks are a separate claim-path symptom, not the bind-side root. With the code-pilot queued pool fully eligible, nulls most plausibly come from the path the lanes actually claim through (sandbox fleet binary -> runtime CONNECT proxy -> laptop broker) and from genuinely thin moments on the small queues (nix queued=7, opencode queued=18), plus claim races across ~30 lanes (SKIP LOCKED, one winner per call). Not cured by this fix; filed here as the follow-up to investigate with shift run logs in hand.
Points 1-5 and all before-metrics stand as filed (each verified twice). The follow-up about attempts-capped queued tasks is withdrawn and replaced by the claim-path investigation above.
Merge pull request #6263 from developing-today/fix/claimant-binding-rate
Merge pull request #6268 from developing-today/fix/claimant-envelope-…
Merge pull request #6270 from developing-today/fix/claimant-cap-36
Merge pull request #6271 from developing-today/fix/claimant-agent-note
developing-today commentedon Nov 5, 2026
Verification (2026-11-05 ~16:40Z) - fix live, backlog drained
Shipped in four PRs, all merged, primary pulled after each, claimant task reinstalled, mode file flipped to
live:{"data": ...}session envelope (it read id/location at the top level, got None, and deleted every session it created), and send_prompt uses the proven POST /api/session//prompt{"text": ...}route instead of /messages.repo-queue signal --worker ..., which is the queue-poke verb and rejected every call. poll.py + claimant.py candidates now carry dedupe_key/title so the ref survives (progress.issue_number is never set by handoffs).Before -> after
Exactly-once audit
Load note (why cap 36, and its limit)
During the drain burst the laptop load peaked at ~15/16 cores (5-min avg) with ~26 fresh worker sessions plus a lane wave, then settled (0.79 at verification). Cap 36 keeps the claimant supplied during lane-runner waves (~39 roots at load ~4) while bounding total roots to ~2x the census level; the spike shows the sessions do draw real CPU in bursts, so 36 is the ceiling I am comfortable with - it is a single constant in poll.py/claimant.py if it needs tuning.
Correction to the diagnosis above
Point 6 of the original diagnosis (attempt-burn making queued tasks unclaimable) was refuted by direct broker measurement and the title has been corrected: a rich list of 200 queued code-pilot tasks showed 200/200 claim-eligible (attempts 0-18 vs max_attempts 20, no future not_before). The worker-shift all-null claims / failure streaks are a separate claim-path symptom - the sandbox-to-broker path and/or claim races on thin queues - NOT caused by the bind side and not cured by this fix. Related live evidence gathered during verification: the queue health RPC currently fails with PostgREST statement timeouts (57014) while /list and the claim path work; the broker/PostgREST layer is the remaining soft spot and deserves its own investigation.
Still open (named follow-ups, not this fix)
[-]opencode-claimant: binding rate — standing claimant stuck in shadow mode, cap 12 starves launches[/-][+]opencode-claimant: binding rate - standing claimant stuck in shadow mode, cap starved launches (12 to 36)[/+]