Skip to content

fix(core): quota gates are credential/provider-scoped and family-blind — Antigravity Gemini (4% used) silenced by its Claude family's wall #1976

Closed

Description

@dezren39

Defect: quota gates are credential-scoped and family-blind — one family's wall silences its sibling family on the same credential

Live evidence (2026-11-07): _antigravity (provider id in telemetry: antigravity-direct) — the Gemini family sat at 4% weekly used, OPEN (reset 2026-11-13T23:43Z) with live seats (gemini-flash-plan is a pool of ONE in the speed route; argon-plan; sonnet/opus fallback), yet recorded zero attempts for ~26h (last 2026-11-07 01:52:52Z).

Mechanism, all three layers verified in opencode.db + fork source:

  1. Provider skip is family-blind by construction. When the Claude/GPT family exhausted (weekly 100%), observeQuotaFailure (credential-less path, packages/core/src/model-route.ts) planted ONE durable adjustment quota:antigravity-direct with match: "antigravity-direct/", until = the Claude family's stated reset 2026-11-09T09:00:22Z. The match is a provider-prefix substring (model-resolver.ts: ModelRoute.skipped → reason user-skip): it matches Gemini targets identically. There is no per-model-family dimension on provider-scope skips.
  2. Credential gate state is credential-scoped, not family-scoped. The Antigravity credential's gate/cooldown state (route_health rows: thousands of cooldown-start for the credential, incl. gemini-3.8-flash targets benched with quota retry-after + quota-gated … quota-known-full against the Claude window's reset) is restored at every server start by restoreCooldownsFrom (model-route-log.ts, 24h replay window). The 2026-11-07 21:04 CST restart re-armed the Gemini targets' benches from the Nov 6 Claude-family exhaustion.
  3. The last Gemini decision on record (2026-11-07 01:52:52Z, gemini-flash-plan) already shows the shape: the pool-of-one's only candidate present in weights yet excluded: cooldown-until:… — after which the route stopped producing served attempts entirely.

So: the Gemini family is healthy, its quota is open, and it is unroutable until the Claude/GPT reset (Nov 9 09:00Z) — because every gate dimension the router has (provider skip, credential gate, credential cooldown restore) is scoped at provider-or-credential granularity, never at the model-family/quota-window granularity the provider's own quota actually has (the quota gatherer already reports the two families as separate windows: Gemini 4% vs Claude+GPT 100%).

Ask

  • Scope quota gates to the quota window/family they were derived from: a gate derived from family A's exhaustion must not exclude family B targets on the same credential/provider. Concretely: provider skips from observeQuotaFailure should carry the model(s) that reported exhaustion (match provider/model prefix), falling back to provider scope only when the report is genuinely provider-wide; credential restore should not re-arm benches on targets of a different family than the one whose window the bench's reset belongs to.
  • Until then, the finest config-level remedy is none: the skip is one durable record with a provider-prefix match; there is no supported way to exempt one family from it.

Related: #1974 (same staleness class, different mechanism — bench evidence vs lapsed gates in the pool verdict).

Acceptance criteria

  • Quota adjustments are scoped per model family: a wall in one family (e.g. Claude) cannot skip routes of a sibling family (e.g. Gemini) sharing the credential/provider prefix.
  • A regression test proves a provider-prefix quota adjustment for one family leaves sibling-family targets attemptable.
  • After the fix, live telemetry shows the under-quota family recording attempts again (the Antigravity Gemini case in the issue: 4% used, zero attempts for ~26h).
  • Single-family skip behaviour is otherwise unchanged (same-family exhaustion still skips, with the family's own reset).

Activity

  1. dezren39 commented on Nov 8, 2026

    @dezren39
    Author

    Design rule recorded (Drew, 2026-11-07 23:02 CST):

    there should be no such thing as a pool level verdict. a pool can't run out only models and providers run out.

    And its companion ruling (23:03 CST): removing records manually doesn't fix anything — fix the code.

    Consequence for this issue: the family-scoping fix must scope quota state per model/provider leg — a provider-wide skip written by one model family's failures must not exclude sibling families, and no route-group (pool) aggregation may reintroduce the exclusion at group level. The pool-verdict synthesis (ModelRoute.poolQuotaExhausted, the pool-quota-exhausted exclusion reason) is removed by the abolition PR linked below: a route group is excludable only leg-by-leg, each leg by its own gate state, with per-leg reasons preserved in decision detail.

    Re-admission form (Drew, 2026-11-07 23:17 CST): re-admission and eligibility derive from per-model/provider quota state and per-leg gate state — quota-driven, judged from the provider's actual quota state (the fleet quota snapshot), never by spending probe attempts. No pool verdicts, no probes.

    Abolition PR: #1979

  2. added 2 commits that reference this issue on Nov 8, 2026
  3. dezren39 commented on Nov 8, 2026

    @dezren39
    Author

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

    Verdict: PARTIALLY FIXED — one remainder still present on current main; feeding a triage packet for the remainder only.

    Checked (fresh gh calls, verified twice):

    What "done" looks like for the triage task:

    1. Design-scope the credential-restore remainder only: how restored benches acquire a family/quota-window dimension (or are re-judged against the current quota snapshot on restore, per Drew's re-admission rule: quota-driven, per model/provider leg, no pool verdicts, no probe attempts).
    2. Record the design verdict and the scoped follow-up route on this issue as an agent-note:v1 comment; route any implementation as a follow-up packet — design/triage only inside this task.
    3. Do NOT redo PR fix(core): quota-driven quota-skip re-admission + per-model reactive skip scoping (#1974, #1976) #1978's merged provider-skip scoping, and do NOT take over fix(core): quota re-admission (#1974) judges a model by whichever window iterates last — a still-full window fails to hold the skip when another window sorts after it #2036 (separately queued).

    Feeder: issue-sweep-rotating (enqueue-only triage feeder; it does not fix, open PRs, or self-assign).

  4. dezren39 commented on Nov 8, 2026

    @dezren39
    Author

    agent-note:v1
    feeder: issue-sweep-rotating
    action: enqueued triage packet (remainder only)
    queue: repo-health-opencode-pilot
    task_id: 13150
    dedupe_key: repo-health:v1:triage:developing-today-forks/opencode:issue:1976
    evidence: triage evidence comment posted this run (PR #1978 merged the provider-skip layer; its stated credential-restore remainder still present on main 07b0352, model-route-log.ts restoreCooldownsFrom :355 has no family/window dimension)
    next: queue lane owns the remainder design/triage; feeder does not fix or self-assign. #2036 (task 13042) is separate and not this remainder.

  5. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/highImportant and time-sensitive
    effort/mMedium: expected under 1 day of work
    source/humanFiled directly by a human
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Nov 8, 2026
  6. dezren39 commented on Nov 8, 2026

    @dezren39
    Author

    Intake review

    Related: parent façade design #1146; sibling open defect #1806 (failover traps sessions on a quota-walled member — same subsystem, different mechanism); provider-naming design #1823.
    Live check: search found no merged PR or closed issue addressing family-scoped quota gates; the defect was verified live 2026-11-07 against opencode.db + fork source per the issue.
    Notes / risks: this silently wastes a paid pool — a family at 4% usage sat idle for ~26h. The adjustment record needs a family dimension, not a narrower prefix hack, or the next provider layout recreates it.
    Suggested approach: add the family dimension to the quota adjustment + ModelRoute.skipped matching, backfill existing adjustments conservatively (treat legacy prefix adjustments as family-unknown and expire them at their stated reset), and add the sibling-family regression test.

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

  7. added
    work/assignedAn agent holds this item via the queue (claimed task)
    queue/claimedA queue worker has claimed the task for this item
    on Nov 8, 2026
  8. 11 remaining items

  9. dezren39 commented on Nov 8, 2026

    @dezren39
    Author

    🤖 Agent note · picked up

  10. added a commit that references this issue on Nov 8, 2026
  11. developing-today commented on Nov 8, 2026

    @developing-today

    Agent note (task 13840, lane opencode-a): this tasks implementation already landed as PR #2160, merged 2026-11-08T20:03:55Z (merge commit 1fcc4b5, in current main history). Verified on fresh origin/main: seedCooldowns re-judge logic present in packages/core/src/model-route.ts and the 5 restore tests present in model-route-log.test.ts. PR #2160 verification: model-route-log 47 pass, model-route + quota-current 146 pass, tsc clean. Completed queue task 13840 as already_done; issue #1976 itself remains open (PR #2160 did not close it). agent-note:v1 repo-queue-worker-shift-opencode lane-a task 13840

  12. dezren39 commented on Nov 17, 2026

    @dezren39
    Author

    🤖 Agent note · done — already triaged, implementation already landed

  13. removed
    queue/claimedA queue worker has claimed the task for this item
    work/assignedAn agent holds this item via the queue (claimed task)
    on Nov 17, 2026
  14. dezren39 commented on Nov 17, 2026

    @dezren39
    Author

    🤖 Agent note · triaged — already resolved in code, live confirmation pending

  15. dezren39 commented on Nov 23, 2026

    @dezren39
    Author

    Claim — Lane WJ (archer), 2026-11-23. Taking opencode#1976 for a verification pass: both code layers are recorded landed (PR #1978 provider-skip family scoping; PR #2160 credential-restore re-judge + tests, both 2026-11-08). The one acceptance criterion never discharged is the live-telemetry one (under-quota sibling family recording attempts again). I will re-verify the code state on current main, run the focused suites, and check live route telemetry on the laptop; close only if every criterion verifies first-hand, otherwise post the verification record with the precise remainder.

  16. dezren39 commented on Nov 23, 2026

    @dezren39
    Author

    Done — Lane WJ (archer), 2026-11-23. Closing as completed: all four acceptance criteria verified first-hand this pass.

    Code criteria (re-verified on current main 8b778a8024, worktree run on the laptop):

    Live-telemetry criterion (the one prior passes left pending) — verified from the laptop's live opencode.db:
    In the week after the fix landed (PR #1978 2026-11-08T06:26Z, PR #2160 2026-11-08T20:03Z), while the Antigravity door was live, Gemini-family targets on antigravity providers recorded attempts every day: Nov 8: 6,869 attempts / 6,661 success · Nov 9: 723 / 112 · Nov 10: 764 · Nov 11: 10 · Nov 12: 24 · Nov 13: 413 / 193 · Nov 14: 2,358 / 1,090.
    The defect's exact shape is discharged on 2026-11-10: claude-sonnet-5-5 recorded 410 cooldown-starts that day (the Claude family being benched hard) while gemini-3.8-flash still recorded 764 attempts the same day, answered and failing on their own merits (RateLimit/Authentication) — pre-fix, that Claude benching is what silenced Gemini for ~26h (Nov 6–7 evidence in the issue).
    After 2026-11-14 the whole Antigravity door went silent for both families together and Gemini traffic moved to the google.* providers (live through today) — a provider-level change with the opposite signature of this defect, not family-blind gating.

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/mMedium: expected under 1 day of workepic/opencode-platformEpic: opencode-platform - all issues of this effort carry itkind/bugSomething isn't working (prefixed form of the classic bug label)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/highImportant and time-sensitivesource/humanFiled directly by a human

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions