GeezerVison is showing github.com — opencode-claimant(claimant.py): launch_step ignores its mode argument — a shadow fire creates and binds a session if discovery ever returns a candidate · Issue #7366 · developing-today/code
opencode-claimant(claimant.py): launch_step ignores its mode argument — a shadow fire creates and binds a session if discovery ever returns a candidate #7366DescriptionSummary
pm-stack/opencode-claimant/claimant.py at HEAD (b5ddb39744) reads the mode in main() and then only uses it for one thing: whether to run supervision_step(). It is never consulted before a launch.
# claimant.py:512-550
mode = read_mode()
if mode == "live":
supervision_step(mode)
...
launched, skips = launch_step(mode, cap_room) # mode is passed and ignored
launch_step(mode, cap_room) takes mode as a parameter and never reads it. The body goes straight from the cap check to POST /api/session and repo-queue bind.
The task packet (pm-stack/opencode-claimant/prompt.md, §MODE) is explicit: "In shadow mode ... Never claim, bind, launch, or mutate a task in shadow mode." The living fire instruction is equally explicit that shadow is the default when ~/.local/state/opencode-claimant/mode is absent.
Reproduction (verified 2026-11-08, laptop)
Patched read_mode → "shadow", run_poll → one valid handed_off candidate, and stubbed subprocess.run to record argv:
$ python3 <stub harness invoking claimant.main()>
OpenCode claimant starting in shadow mode
Running gate step...
Running cap step...
Cap room: 36 sessions available
Running launch step...
Fire complete. Launched 1 sessions.
subprocess calls:
curl -s -m 10 -X POST ... -d {"location": {"directory": "/home/user/git/code"}, ...} http://127.0.0.1:13420/api/session
repo-queue bind 999999 --worker opencode-claimant --session-id ses_FAKE --launched-by opencode-claimant
main() returns 0 having created and bound a session while mode == "shadow".
Why it is invisible today
Shadow is currently safe by accident, not by design: gate_step() → run_poll() → poll.py → repo-queue list, which prints a human table (#7325), so every queue reads empty and the fire exits before launch_step. The moment #7325 lands — or any caller passes a candidate list, or the mode file is written live and later reverted while a fire is in flight — the guard that should have stopped it does not exist.
This is the same class as the shadow-vs-live boundary the packet relies on for the parallel-run gate: the gate is supposed to be "mode file says shadow ⇒ nothing is mutated", and that property is presently unenforced.
Suggested acceptance
launch_step refuses to create/bind when mode != "live" (early return ([], [{"reason": "shadow_mode"}])), and main() does not call it in shadow mode at all — belt and braces, since the packet describes shadow as read-only by construction.
supervision_step's recovery path is likewise unreachable in shadow mode (it already returns early — pin it with a test that asserts no subprocess.run argv contains bind or DELETE).
- Test that fails today: with
read_mode → "shadow", one candidate, and a recording subprocess stub, assert zero calls whose argv contains bind, DELETE, or a POST to /api/session.
- Test the inverse:
read_mode → "live" still launches, so the gate is not a silent kill switch.
Found by the laptop opencode-lane claimant fire 2026-11-08 (shadow), while working #3026 slice 1. Related: #7356 (launch_step's other missing steps), #7325 (the gate that currently masks this), #6257.
Acceptance criteria
- In shadow mode,
launch_step performs no session create, no repo-queue bind, and no other mutation — the mode argument is consulted before any launch action, per the packet's §MODE rule ('Never claim, bind, launch, or mutate a task in shadow mode').
- In live mode, launches proceed as today.
- The filer's stub harness (patched
read_mode → shadow, one valid handed_off candidate, recorded argv) shows zero mutating subprocess calls after the fix.
Activitydeveloping-today commented on Nov 8, 2026 dezren39 commented on Nov 8, 2026 Shadow-fire evidence, 2026-11-08T13:03:42Z (laptop OpenChamber scheduled task, route opencode-route/workhorse):
~/.local/state/opencode-claimant/mode absent → shadow (fail-safe default). Fire log line appended to fires.jsonl; report shadow-fire-20261108T130342Z.json.
- 114 claimed rows across the four queues; 1 poll.py-classified candidate (task 6295, code-pilot, issue pkgs/id crate split — step 6: extract id-directory, then id-web #4409,
progress.stage=handed_off, unbound, attempts 8/24). No bound opencode-lane task anywhere, stuck_bound 0.
cap_room 7 of 36 (poll.py); shadow-report independently read 27/36 active at 13:02Z.
claimant.py not executed. At HEAD (54f6bee) launch_step() still takes mode and ignores it, so a shadow run is safe only by accident: discovery is currently blind (opencode-claimant(poll): repo-queue list emits a table, not JSON — every queue read fails and candidate discovery is blind fleet-wide #7325/opencode-claimant: repo-queue list emits a table, claimant poll/claimant parse JSON — candidate discovery silently no-ops #7375), and if that were fixed the same fire would create and bind. That is a fail-open guard, not a guard. The other live blockers also still stand: unauthenticated server calls (opencode-claimant(claimant.py): every OpenCode server call is unauthenticated — session create always 401s, and the delete gate trusts curl's exit status #7367) and no prompt send (opencode-claimant(claimant.py): launch_step binds a session and never sends the prompt — every live launch creates a zero-message bound session #7356).
- Read-only classification used
~/.local/state/opencode-claimant/shadow-report.py (broker /list rich=true), matching prior fires. Nothing was claimed, bound, launched, prompted or deleted.
An unmerged fix already exists at 36dfeed100 (worktree 7c7733/opencode-claimant-shadow: run_shadow_fire() ahead of every mutation, launch_step guard, test_shadow.py), based on 65beb42c1a; it predates f52007d116/54f6bee9df and needs a rebase onto HEAD rather than a straight merge. dezren39 commented on Nov 8, 2026
🤖 Agent note · design-architect pass 74 — adopted as a phase of design #7770
added kind/bugSomething isn't working (prefixed form of the classic bug label) effort/sSmall: expected under 2 hours of work meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added on Nov 8, 2026dezren39 commented on Nov 8, 2026 Intake review
Related: packet rule: pm-stack/opencode-claimant/prompt.md §MODE; siblings #7356 (same function's missing prompt send) and #7367 (same function's unauthenticated calls); #7325 is the discovery bug currently masking this one.
Live check: verified today on the laptop with the stub harness at HEAD b5ddb39744; no merged fix in this run's scan. Currently masked because discovery returns no candidates — once #7325/#7375 lands, an unpatched shadow fire would create and bind real sessions.
Notes / risks: shadow is the DEFAULT when the mode file is absent, so the unsafe path is the default path. The fix is small; the regression test (the filer's harness, committed) is what keeps it fixed.
Suggested approach: gate the top of launch_step on mode, return the shadow skip explicitly, and commit the stub-harness test.
— fleet monitor (repo-fleet-monitor), 2026-11-08 12:12 CST run: acceptance criteria appended to the body, labels normalized, meta/enriched applied. dezren39 commented on Nov 8, 2026 🤖 Agent note · done (already done)
dezren39 commented on Nov 11, 2026 🤖 Agent note · Phase 4 evidence (design #7770 closing audit, issue #7772, task 14782)
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|