Skip to content

opencode-claimant(claimant.py): gate-exit logs a hardcoded cap_room 0 — idle fires read as cap-saturated #7732

Closed

Description

@dezren39

Symptom

Every claimant.py fire that ends at the gate writes a false cap_room: 0 into the fire log:

{"timestamp": "2026-11-08T14:20:19Z", "mode": "shadow", "candidates_seen": [], "sessions_launched": [], "cap_room": 0, "skips": [{"reason": "no_candidates"}]}

But poll.py, run seconds later against the same server, reports real headroom:

cap: 36  concurrency_cap: 36  live_root: 9094  active_root: 4  cap_room: 32

Cause

claimant.py:533 hardcodes 0 in the gate-exit path:

if not has_candidates:
    print("No unbound opencode-lane candidates found. Exiting.")
    log_fire(mode, [], [], 0, [{"reason": "no_candidates"}])
    return 0

cap_step() is never reached — it runs after the gate — so the value logged is a placeholder, not a measurement.

Why it matters

cap_room in fires.jsonl is the field an operator reads to answer "was this fire idle because the fleet was full, or because nothing was eligible?" With the gate-exit path writing 0, every candidate-less fire is indistinguishable from a saturated one.

This is not hypothetical confusion: the fire log shows cap_room: 0 for the 14:05, 14:10, 14:15 and 14:20 fires on 2026-11-08 while the true cap_room was ~31-32. A reader would conclude the fleet was pinned at the 36 cap; it was at 4 active roots.

It also masks #7325. A blind-discovery fire and a genuinely-empty-queue fire both log no_candidates with cap_room: 0, so the log cannot distinguish "nothing to do" from "I could not read the queues."

Suggested fix

  • In the gate-exit path, log null (unknown) rather than 0, since the cap was not measured on that path.
  • Optionally run cap_step() before the gate so every fire log carries a measured cap count, and record candidates_seen as unknown-vs-empty.

Environment

  • claimant.py at HEAD f9dfb4cfa5
  • Laptop OpenCode server http://127.0.0.1:13420
  • Shadow mode (no ~/.local/state/opencode-claimant/mode)

Acceptance criteria

  • A gate-exit fire (no candidates) logs cap_room as null/unknown — never a hardcoded 0 — in fires.jsonl.
  • If the optional measured path is chosen instead, the logged value comes from cap_step() run on that fire, and reconciles with a poll.py reading taken at the same time.
  • A regression test or fixture fire proves an idle fire's log line cannot be mistaken for a saturated one.

Activity

  1. developing-today commented on Nov 8, 2026

    @developing-today
    Contributor
  2. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/normalOrdinary priority (the default)
    effort/sSmall: expected under 2 hours of work
    source/humanFiled directly by a human
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Nov 8, 2026
  3. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    Intake review

    Related: #7325 (blind discovery — the masking interaction named in the issue); claimant siblings #7760 (zero-message gate) and #7706 (yield-field mismatch).
    Live check: fresh defect filed today from the live fire log (14:05–14:20Z fires logging cap_room 0 against a true ~32); no merged fix found this run.
    Notes / risks: telemetry-only, but it corrupts the operator's one signal for 'idle vs saturated' and masks #7325. Null-for-unknown is the honest encoding; a measured value is better only if the cap step's cost on every idle fire is acceptable.
    Suggested approach: log null on the gate-exit path (claimant.py:533), and record explicitly whether candidates were unknown vs empty so the two idle causes stay distinguishable.

    — fleet monitor (repo-fleet-monitor), 2026-11-08 10:12 CST run: acceptance criteria appended to the body, labels normalized, meta/enriched applied.

  4. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · design-architect pass 74 — adopted as a phase of design #7770

  5. added
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    and removed on Nov 10, 2026
  6. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · triaged

    • Agent: triage-step
    • State: triaged
    • Verdict: work kind task/small-fix · priority/normal · effort/s · kind/bug
    • Priority why: priority/normal — brief line 5: a claimant logging bug that misreads idle as cap-saturated; misleading, but lanes still claim (its seam-contract parent is Act only on a verified read — one seam contract for the opencode-claimant #7770).
    • First step: In pm-stack/opencode-claimant claimant.py (:533 gate-exit path), log the real cap_room from the poll/read instead of the hardcoded 0.
    • Acceptance: A gate-exit fire with real headroom logs that headroom (not cap_room: 0), and a genuinely saturated gate still logs 0, with the claimant tests covering both.
    • Fix packet: repo-health:v1:fix:developing-today/code:issue:7732 → queue repo-health-code-pilot, task 14535.
  7. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · parked — conflicting active work in the primary

  8. 5 remaining items

  9. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 10, 2026
  10. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 — state: parked (awaiting CI) (task 14535, lane code-e)

  11. added a commit that references this issue on Nov 10, 2026
  12. dezren39 commented on Nov 10, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done (task 14535, lane code-k)

  13. removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    work/assignedQueue worker lifecycle state
    on Nov 10, 2026
  14. dezren39 commented on Nov 11, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · Phase 4 evidence (design #7770 closing audit, issue #7772, task 14782)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)source/design-architectFiled by the repo design architect jobsource/humanFiled directly by a humanstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions