Repository navigation
Description
Symptom
Every fire of pm-stack/opencode-claimant/poll.py prints, for all four queues:
Warning: Could not poll queue repo-health-code-pilot: Expecting value: line 1 column 1 (char 0)
Warning: Could not poll queue repo-health-opencode-pilot: Expecting value: line 1 column 1 (char 0)
Warning: Could not poll queue repo-health-openchamber-pilot: Expecting value: line 1 column 1 (char 0)
Warning: Could not poll queue repo-health-nix-pilot: Expecting value: line 1 column 1 (char 0)
and reports candidates: [], stuck_bound: [] for every queue.
Cause
fetch_claimed_rows() (poll.py:288) runs:
repo-queue list --queue <queue> --status claimed
and then json.loads(result.stdout). But ~/fleet-brokers/bin/repo-queue list emits a human-readable table, not JSON. There is no JSON mode in the CLI either:
$ repo-queue list --queue repo-health-code-pilot --status claimed --json
repo-queue: unrecognized argument: --json
$ ... --format json -> unrecognized argument
$ ... --output json -> unrecognized argument
So json.loads always raises and every queue contributes zero rows.
Impact
This is not a transient outage — the claimed set is large. At fire time 2026-11-08T05:45Z the four queues held 37 claimed tasks (code 20+, opencode 7, openchamber 3, nix 6). The claimant cannot see any of them, so:
- Candidate discovery is blind fleet-wide. Any claimed, lane-
opencode, unbound task at a recorded yield stage is invisible and never launched. The fire ends "No unbound opencode-lane candidates found" and looks healthy. - Supervision is blind.
stuck_bound(the opencode-claimant: bound session that never received its prompt (task 6722) has no recovery path — stuck claimed forever #4758 zero-message / gone-session recovery set) is derived from the same claimed rows, so bound-but-dead sessions are never reported or recovered. - The fire log under-reports.```cap_room
is recorded as 0 withskips: [{reason: no_candidates}]` even when a direct poll shows room (23 at the time of this report). A saturated-cap reading and an unreadable-queue reading are indistinguishable in the log.
This is the "standing claimant never went live" failure mode in a new form: the process runs, exits 0, and reports nothing to do.
Proposed fix
Either:
- Give
repo-queue lista JSON output mode (--json) that serialises the broker rows includingprogress, and havefetch_claimed_rows()use it; or - Have poll.py reach the queue-broker HTTP API directly (the same route the CLI uses) and parse the rows there.
Option 1 is smaller and keeps poll.py's "read-only by construction" property anchored on the CLI. Whichever is chosen, poll.py should also distinguish "queue unreadable" from "queue empty" in its output and in the claimant fire log, so a broken read can never be reported as no_candidates.
Verification
$ repo-queue list --queue repo-health-opencode-pilot --status claimed
returns a table with 7 claimed rows; python3 pm-stack/opencode-claimant/poll.py should then report those rows (filtered by lane/stage) instead of [].
Related: #6865 (claimant.py imports), #6868 (poll.py crash on malformed session time), #4758 (recovery rule), #3026 (slice 1).
Acceptance criteria
- The problem described above is confirmed against current main (reproduced or traced to the named code path), or the issue is closed with that evidence.
- A fix/implementation addressing the described behaviour is merged via PR referencing this issue, with tests naming their oracle where the change has meaningful invariants.
- Related step/sibling issues from the same filing batch are cross-linked and any dependency is recorded as a native blocked-by relation.
Activity
developing-today commentedon Nov 8, 2026
CODE-2258
dezren39 commentedon Nov 8, 2026
Reproduced on the 2026-11-08 opencode-claimant fire (shadow mode, laptop primary).
poll.pyemitted the fourExpecting value: line 1 column 1warnings and returnedcandidates: [],stuck_bound: []. Direct CLI reads at the same moment show 36 claimed tasks across the four queues (code 20, opencode 7, openchamber 5, nix 2) — all invisible to the claimant.Two aggravating details found in the same fire:
claimant.pyrecordedcap_room: 0withskips: [{reason: no_candidates}], while a directpoll.pyread reportedactive_root_sessions: 10andcap_room: 26of 36. So a broken queue read is logged as a saturated cap and as no work — exactly the indistinguishable-from-healthy failure the issue predicts. (claimant.py'scap_step()also subtractspoll.py's already-computedcap_roomfrom 36 a second time, which would under-report room even with a working poll.)stuck_boundderives from the same claimed rows, so opencode-claimant: bound session that never received its prompt (task 6722) has no recovery path — stuck claimed forever #4758 zero-message / gone-session recovery cannot fire while this is open.Also filed #7349:
repo-queue listandhealthreject--worker, which the packet mandates on every verb — relevant to whichever fix route is taken here, since option 1 (a--jsonmode) will be touched alongside it.dezren39 commentedon Nov 8, 2026
Additional facet found on the 2026-11-08T06:25Z shadow fire (laptop primary,
main@9615ae1e11):repo-queue listdoes not only emit a table — it caps its output at 20 rows, with no pagination or offset flag. So option 1 (a--jsonmode forlist) would not be sufficient for the claimed set as it stands:listwith--offset,--page,--after,--all,--limitall fail asunrecognized argument(the same class as the--json/--formatrejections in the body). The three queues below 20 rows matchhealthexactly; code-pilot is capped.Consequence: at 06:26Z the four queues held 190 currently-claimed tasks (code 181, openchamber 5, opencode 2, nix 2) and
poll.pysaw none — and even a JSON-shapedlistwould still return at most 20 rows for code-pilot. This points at option 2 (poll.py reads the broker HTTP API directly and requests the full claimed set) rather than adding--jsonto a verb that is itself truncated.Supervision was clean this fire: the 6 lane-ledger-bound opencode sessions all exist, are terminal (
time.idle+outcome: succeeded) and carry messages, so none satisfy the #4758stuck_boundrule. Related: #7349 (--workerrejected), #6868, #6865.dezren39 commentedon Nov 8, 2026
Claimant fire 2026-11-08T06:3xZ — reproduction confirmed, plus two sharpening details
Shadow fire on the laptop (mode file absent →
shadow, so no claim/bind/launch):Expecting value: line 1 column 1);poll.pytherefore reportscandidates: [],stuck_bound: [], andcap_roomfromsummarize_caponly.Two facts that narrow the fix:
1. Switching to the canonical
fleetbinary does not help. The deployed client~/fleet-brokers/bin/repo-queueis the pre-fleet rollback build (fleet-brokers/SUPERSEDED.md);poll.pypoints at it viaREPO_QUEUE_CMD. The canonicalfleet queue(
~/.local/bin/fleet, source rev48cd308ac5b9,pkgs/fleet/crates/fleet-queue/src/client.rs)has the same defect:
cmd_listhard-codes the six-column table andparse_argsaccepts onlyqueue/status/limit/not-before, so--json,--rich,--formatare allunrecognized argument. The fix has to land in the client (or in poll.py), not in the binary choice.2. A JSON mode alone is still insufficient unless it also carries the rich columns and a usable limit.
The broker
/listverb already supports both —rich: truereturnsworker_id, lease_until, lane_id, attempts, max_attempts, progresson top of the table columns(
turso_queue.rs:2368), andlimitis validated1..=500. The client sends neither(
richis never set;limitdefaults toLIST_LIMIT_DEFAULT = 20). Twenty rows is below thecurrent claimed set in every queue (191 / 2 / 6 / 1 at fire time), so a thin
--jsonwould stillhave hidden ~170 claimed rows and every
progress-bearing field the classifiers read.Verified working read path (used to produce this fire's shadow report, no code change):
POST
/list{"queue": q, "status": "claimed", "limit": 500, "rich": true}through the same~/.config/repo-queue/broker-url+~/.config/queue-broker/tokenroute the CLI uses. That yields189 claimed rows across the four queues and 14 real
is_candidate()hits at fire time(5 × priority 15, 9 × priority 30 in
repo-health-code-pilot; the other three queues have none),all
stage: handed_off, all unbound, none carrying a hard-stop label.Supervision is genuinely empty, not merely unread: zero claimed rows carry
progress.session_idin any queue. (85 bound sessions exist fleet-wide, all onblocked/failed/donerows, which supervision does not cover.) Sostuck_bound: []aboveis a true zero once the read is fixed.
Scope note: even with #7325 fixed, live launch stays inert until #6865 lands —
claimant.pyat HEAD is the shadow-only stub (
launch_stepfabricatessim-ids) and its owntest/test_claimant.pyerrors 4/4 on missing_POLL/_verify_candidate_is_current.PRs #6990 and #7290 are the restores. Cap is not the constraint:
cap_room30 vs 14 would-launches.dezren39 commentedon Nov 8, 2026
Independent confirmation from a shadow fire (2026-11-08T06:35Z)
Reproduced on the laptop primary clone,
modeabsent → shadow:Directly against the same binary, same argv poll.py uses:
So the failure is deterministic and
rc == 0, which is why nothing abovefetch_claimed_rowsnotices. Confirmed there is no JSON mode:--json,--format json,--output jsonare all "unrecognized argument", andstringson the binary shows no such flag.Two additions beyond the original report
claimant.pysupervision has the same defect, independently.supervision_step()(claimant.py:~188) makes the identicalrepo-queue list --status claimedcall and doesjson.loads(result.stdout)inside a bareexcept Exception: continue. In live mode that means step 1 — the supervision the Move opencode executions to laptop-side scheduled tasks — retire the Muse boot handoff #3026 choice puts first — silently supervises nothing. Fixing onlypoll.pyleaves supervision blind. Both call sites need the same treatment.The test suite cannot catch this.
test_poll.py::TestFetchClaimedRowsstubssubprocess.runand feeds itjson.dumps(payload), so it asserts against a JSON contract the real CLI does not honour. Any fix should add a test that pins the actual CLI output shape (or, if option 1 lands, that--jsonis passed), otherwise the stub keeps the regression green.Fire-log note
The fire at 06:35Z logged
cap_room: 0, skips: [{reason: no_candidates}]— cap_room 0 is also wrong (a direct poll showed 30). I appended a corrected line for that fire recordingqueue_read_failure_false_emptyandcap_room: 30. Agreed with the proposal that the fire log must distinguish "queue unreadable" from "queue empty"; right now a total read failure is indistinguishable from a quiet fleet.dezren39 commentedon Nov 8, 2026
Second finding after #7290 merged — the gate is now the only thing blocking live launches, and the restored launch path stops at
bindRe-ran a shadow fire after PR #7290 merged (#6865 closed 06:31:52Z) and the primary fast-forwarded to
9f5a92057d.#7325 still reproduces at HEAD.
poll.pyfetch_claimed_rows()is unchanged since8e2607a4fe: it shells~/fleet-brokers/bin/repo-queue list --queue Q --status claimedandjson.loadsthe table, so all four queues warn andcandidatesis[].claimant.py's gate callsrun_poll(), so the restored live path inherits the blindness verbatim.Consequence for priority: this is now the single blocker between
cap_room: 30and 13 real would-launches.A read-only
POST /list {status:"claimed", limit:500, rich:true}returns 170 claimed rows inrepo-health-code-pilot, of which 13 passpoll.is_candidate()(5 at priority 15, 8 at priority 30; zero in the other three queues). None carries a hard-stop label. 5 of the 13 areattempts >= max_attempts.Two further defects the fixed read exposes in the restored
launch_step(HEAD9f5a92057d,claimant.py:347-509)These matter because the moment #7325 lands, live mode stops being a no-op and starts doing them:
claimant.py:477-489builds thepromptf-string and then says# In a real implementation, this would send the prompt via the session API / For now, we just record the successful launch.There is no
POSTto the session. A live fire would therefore bind a session and never prompt it — creating exactly the zero-message bound state that opencode-claimant: bound session that never received its prompt (task 6722) has no recovery path — stuck claimed forever #4758's recovery rule exists to clean up, on every launch, for every task.checkpoint --stage launched(step 4c), no agent-note (4e), no hard-stop label check, noattempts < max_attemptsgate.grepforcheckpoint,agent-note, and the four hard-stop labels inclaimant.pyreturns zero hits each. Launch order is still create → verify location → bind → drop prompt, which is bind-safe but leaves no launched stage on the task and no issue record.So the ordering is right (create → verify
location.directory→ bind) and the bind failure path deletes the session — that part matches the spec. What's missing is everything after bind.Suggested split (both are pre-existing at HEAD, neither is caused by the restore):
rich+ a limit above the default 20, or havepoll.pyread/listdirectly; and distinguish unreadable from empty in the fire log.launch_stepprompt delivery +checkpoint launched+ agent-note + hard-stop/attempts gates, guarded by a test that asserts aPOSTto the bound session id happens before the candidate is recorded as launched.Supervision is genuinely empty right now: zero claimed rows in any of the four queues carry
progress.session_id, sostuck_bound: []is a true zero rather than a read failure.dezren39 commentedon Nov 8, 2026
Split out as #7356: the restored
launch_stepbinds a session and never sends the prompt (plus missingcheckpoint launched, agent-note, hard-stop/attempts gates, and the single-instance lock / bounded pool the task description claims). That is pre-existing at HEAD and independent of this read defect — but it becomes live the moment this lands.dezren39 commentedon Nov 8, 2026
🤖 Agent note · shadow claimant fire 2026-11-08T13:00Z
Re-confirmed at HEAD from the OpenChamber scheduled claimant (task
f1b4a33b-…, mode file absent → shadow).poll.pyreportedclaimed: 0,candidates: 0,stuck_bound: 0for all four queues andcap_room: 22.repo-queue healthat the same moment: 103 claimed (code 89, opencode 9, openchamber 3, nix 1).repo-queue list --queue <q> --status claimedemits the 6-column table;json.loadsraisesExpecting value: line 1 column 1 (char 0),fetch_claimed_rowslogs to stderr and returns[].Second defect on the same path (not yet filed). Even once
listemits JSON,poll.is_candidatereadsprogress.stage, but checkpoints writeprogress.last_checkpoint.stage. Inrepo-health-code-pilot, 84 of 86 claimed rows carry onlylast_checkpoint.stage; 8 carry a top-levelstage, and those are non-yield stages (claimed,awaiting_ci,implementation_complete,parked). So the stage fix alone would still hide the recorded yields.Worked example, read-only. Reading the broker's rich
/listdirectly and applyingpoll.is_candidate's filter with the stage read fromlast_checkpoint.stageyields 70 unbound handed_off candidates (code 64, opencode-pilot 5, nix 1; priorities 1×p20, 65×p30, 1×p40, 3×p50). Againstcap_room 22, a live fire would launch 22 and skip 48 for cap saturation.Nothing was claimed, bound, launched or mutated. Fire log:
~/.local/state/opencode-claimant/fires.jsonl(last line).dezren39 commentedon Nov 8, 2026
🤖 Agent note · design-architect pass 74 — adopted as a phase of design #7770
files/designs/code-claimant-seam-contract.mdin the keep-the-four-repos-healthy goal workspace. Audit at origin/mainb64288a567.dezren39 commentedon Nov 8, 2026
🤖 Agent note · done (already_done)
direct.dezren39 commentedon Nov 11, 2026
🤖 Agent note · Phase 4 evidence (design #7770 closing audit, issue #7772, task 14782)
pm-stack/opencode-claimant/README.md(PR claimant: #7770 Phase 4 closing audit — seam contract, fire-log unknowns, stub-shape fix (#7772) #8367): queue rows are read via the broker's rich/list(poll.py_broker_post/_fetch_rows,rich: true, limit 500) with the yield lifted fromprogress.last_checkpoint.stageper opencode-claimant(poll): candidate filter reads progress.stage, but the checkpoint verb writes progress.last_checkpoint.stage — ~60 recorded yields invisible per fire, stale stages offered unsafely #7706 option A (normalize_rowonly lifts when no live stage is set, so a live later stage vetoes a stale yield).eb1f9987eb), and the CLI still has no JSON list mode (verified live 2026-11-11:listprints the human table). The pin's intent is met; the letter is not — recorded on Act only on a verified read — one seam contract for the opencode-claimant #7770 for the design thread.candidates_seen: null(PR claimant: #7770 Phase 4 closing audit — seam contract, fire-log unknowns, stub-shape fix (#7772) #8367).