Skip to content

fix(core): pool quota exclusion defeats due bench probes — probe-eligible leaves stay excluded until the escalated cooldown expires (PR #1384 Codex P2 unaddressed) #1390

Closed

Description

@dezren39

Origin: Codex P2 review finding on PR #1384 (merged 2026-11-02 as f7b4c02), thread on packages/core/src/model-route.ts (line 541 at head 4794119), left unresolved at merge. Verified still present on current main by queue task 6188 (lane A, 2026-11-02).

Problem

When two pool members carry quota benches and a trusted reset is learned after those benches were created, armBenchProbe (packages/core/src/model-route.ts ~line 451) makes them probe-eligible at the reset without shortening their cooldowns — the existing half-open recovery path. But quotaOut (~line 546) / poolQuotaExhausted (~line 609) still count both leaves as quota-out until their original cooldowns expire, so the pool verdict stays exhausted and the resolver excludes every member, including the due probes, from both normal selection and the all-full last resort. A recovered pool can stay unavailable until the escalated cooldown expires (up to 24 hours), defeating the probe path.

Fix direction (from the Codex finding)

Account for due probes when applying the pool exclusion: a leaf whose bench probe is due (probeDueState, ~line 459) should not count toward the pool-exhaustion threshold (or the exclusion should admit the due probe), while a claimed/outstanding probe and not-yet-due benches keep counting.

Acceptance

  • With two pool leaves quota-benched and a trusted reset learned, once the reset passes the pool is no longer excluded as a whole: the due probe leaf is selectable for its half-open probe.
  • Before the reset, or while a probe is already claimed, the pool exclusion still applies.
  • New regression test beside packages/core/test/model-route.test.ts pool-shaped tests demonstrating the due-probe case.
  • packages/core model-route + model-resolver suites pass; typecheck clean.

Part of the #1014 PR3 follow-up set; does not reopen #1014's other routed packets.

Acceptance criteria

  • With two pool leaves quota-benched and a trusted reset learned, once the reset passes the pool is no longer excluded as a whole: the due-probe leaf is selectable for its half-open probe.
  • Before the reset, or while a probe is already claimed, the pool exclusion still applies.
  • A new regression test beside packages/core/test/model-route.test.ts pool-shaped tests demonstrates the due-probe case.
  • packages/core model-route and model-resolver suites pass; typecheck is clean.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/normalOrdinary priority (the default)
    app/corePackage: core (pkgs/ or apps/ in this repo)
    effort/sSmall: expected under 2 hours of work
    on Nov 2, 2026
  2. dezren39 commented on Nov 2, 2026

    @dezren39
    Author

    Intake review

    Origin: Codex P2 finding on PR #1384 (merged 2026-11-02 as f7b4c02), thread at model-route.ts line 541, left unresolved at merge and verified still present on current main by queue task 6188. Part of the #1014 PR3 follow-up set (sibling: #1389, the shared-gate counting flaw in the same functions). Still live. Risks: a recovered pool can stay unavailable up to 24h, defeating the half-open probe path that exists precisely to avoid that. Suggested approach: exclude due-probe leaves (probeDueState) from the pool-exhaustion count, keeping claimed/not-yet-due benches counted.

    — fleet monitor intake enrichment (protocol §5), 2026-11-02 run. Original body preserved verbatim above the appended acceptance-criteria section.

  3. added
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Nov 2, 2026
  4. dezren39 commented on Nov 2, 2026

    @dezren39
    Author

    Triage evidence — issue-sweep-rotating feeder, 2026-11-02

    Verified still present on current main 5724210481d2 via gh api raw read of packages/core/src/model-route.ts:

    • poolQuotaExhausted (:638-652) builds the out-set purely from quotaOut(...) per leaf and returns out.size >= POOL_QUOTA_LEAVES — there is no probe-due carve-out anywhere in the function.
    • quotaOut (:577) returns true for a quota-benched leaf without consulting probeDueState (:488), even though armBenchProbe (:480) deliberately arms due probes at a learned reset via the half-open path.

    So a leaf whose bench probe is due still counts toward pool exhaustion: with two benched leaves the pool verdict stays exhausted and the resolver excludes every member — including the due probes — from normal selection and the all-full last resort, exactly as the issue describes (Codex P2 on PR #1384, thread at model-route.ts:541 at head 4794119cf5, unresolved at merge).

    Done looks like (per the issue's acceptance): once a trusted reset passes, the due-probe leaf no longer counts toward the pool-exclusion threshold and is selectable for its half-open probe; before the reset or while a probe is claimed, exclusion still applies; new regression test beside the pool-shaped tests in packages/core/test/model-route.test.ts; model-route + model-resolver suites pass, typecheck clean.

    Enqueued as a triage packet to the repo-health-opencode-pilot queue by this feeder run. Sibling: #1389 (shared-gate counting in the same functions).

  5. dezren39 commented on Nov 2, 2026

    @dezren39
    Author

    🤖 Agent note · queued

  6. added
    queue/queuedHas a queued task in the Supabase agent queue
    work/assignedAn agent holds this item via the queue (claimed task)
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 2, 2026
  7. 2 remaining items

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

    @dezren39
    Author

    Handed off (queue task 6620): execution lane assigned opencode by repo-queue lane assignment; the laptop opencode-claimant will launch a bound session for this task. Prior revalidation (task progress): issue OPEN, packet accurate on main, no competing PR, no held/Drew-owned labels.

  10. dezren39 commented on Nov 3, 2026

    @dezren39
    Author

    agent-note:v1 — state: handed off

    Queue task anomalyco#6620 is handed to OpenCode for execution.

  11. added
    queue/queuedHas a queued task in the Supabase agent queue
    task/triageQueue packet kind: verify, reproduce, and route this item
    and removed
    queue/claimedA queue worker has claimed the task for this item
    on Nov 3, 2026
  12. dezren39 commented on Nov 3, 2026

    @dezren39
    Author

    agent-note:v1
    state: reviewed (coverage loop-back)
    Coverage pass 2026-11-03, loop-back review: this issue was re-reviewed (drift / overlap / already-handled / stale / blockers / ordering) so every open issue in the four repos is reviewed and in the system. Verdict: still live; in the system as task 7146 (triage, queued, priority 40) in repo-health-opencode-pilot. Labels audited and synced. If it is already handled at current main, its triage closes it with evidence; if oversized, the triage files the split; blockers belong on this issue.
    Found via: coverage loop-back 2026-11-03

  13. dezren39 commented on Nov 3, 2026

    @dezren39
    Author

    🤖 Agent note · triaged — fix in flight on PR #1473, blocked on conflict + Codex P2

  14. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 3, 2026
  15. dezren39 commented on Nov 7, 2026

    @dezren39
    Author

    🤖 Agent note · check-in

  16. dezren39 commented on Nov 8, 2026

    @dezren39
    Author

    Partial verification — staying open (2026-11-07 done-task-only audit, tracking: developing-today/code#7016).

    Queue task(s) [7146, 6620] were marked done, and some work did land:

    No merged change closes this issue's full scope, so the done status is not treated as completion. Remainder re-queued as triage task 11494.

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

    app/corePackage: core (pkgs/ or apps/ in this repo)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)queue/parkedQueue task is parked (waiting on CI, time, or an event)source/pr-diff-reviewFiled by the pr-diff-review jobstatus/in-progressActively being workedtask/triageQueue packet kind: verify, reproduce, and route this itemwork/assignedAn agent holds this item via the queue (claimed task)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions