GeezerVison is showing github.com — Quota-aware walling: bench providers whose binding window is <1% and failing with quota errors · Issue #2256 · developing-today-forks/opencode
Quota-aware walling: bench providers whose binding window is <1% and failing with quota errors #2256DescriptionDoctrine (Drew, 2026-11-10)
Providers are never put in disabled_providers for quota reasons. The fork owns walling: it has the measured quota (the same read the gatherer publishes) and it sees every failure. A provider whose binding window is nearly gone and is failing must be treated as walled by the router itself.
Drew's words: "you don't put models to disabled — the opencode fork should know the quota and see the failures and figure out that it's below 1pct and failing every time or has a quota related error". And on the concrete case: "$0.05 left is walled, nothing will run."
Today's evidence (2026-11-10, live reads)
- Command Code monthly measures 99.513% used ($9.95 / $10 — $0.05 left); its 5h reads 0/3, weekly 64.6%.
- The quota read still reports the provider state as "ok"; it is not in
disabled_providers (removed 2026-11-06 on Drew's order, in reliance on the availability system).
- Its seats remain live in the plan pools (deepseek-flash-plan weight 1, deepseek-pro-plan weight 0.5), so sessions can still be routed onto a pool that cannot pay for a real call.
- Provider availability: one state machine for quota / rate-limit / unknown / infra stops #1828's availability state machine benches on a classified quota/balance failure and releases on measured increase — but the bench decision does not use the measured quota level itself: at <1% remaining the router keeps offering the seats until failures accumulate, one dribbling session at a time.
Expected behavior
- The route layer consumes the measured quota per provider (binding window = the window that actually gates calls, e.g. monthly for Command Code).
- When the binding window measures <1% remaining AND the provider is returning quota-class errors (or failing every attempt), the provider is walled immediately: benched, seats not offered, no further attempts dribbled into it.
- Rejoin is the existing measured-increase path (window reset or balance increase re-admits automatically) — never a config edit, never
disabled_providers.
- The wall state is visible in the route/quota surfaces as walled-below-1%, distinct from a generic error bench, so reports stop describing a dead pool as "ok / not walled".
Acceptance
- With a provider at <1% on its binding window and quota-class failures present, route decisions show it walled with zero new attempts routed to it.
- A measured increase on the binding window re-admits it with no config change.
- Command Code today would read as walled under this rule ($0.05 of $10 left).
Activitydezren39 commented on Nov 10, 2026 Refinement (Drew, 2026-11-10 14:36 CST)
Two corrections to the trigger design:
- One failed call could be anything and must not bench a provider forever. A lone failure — any class — is not a wall. Transient benches recover on their own; nothing in this issue asks for permanent benching from a single error.
- The wall signal is the combination, not either half alone:
- the measured quota on the binding window is nearly gone (the concrete case: $0.05 of $10 left, <1% remaining), and
- the failures are errors that imply plan limits (quota-class: insufficient credits / quota exceeded / balance exhausted) — not generic errors.
- Action on that combined signal: wall the provider — or at minimum fully deprioritize it (effective weight ~0, never picked while any alternative exists). Either satisfies the requirement; a full wall is the cleaner form.
- Release stays as specified: measured increase on the binding window (reset/refill) re-admits automatically.
In short: low-quota alone is a warning state; low-quota + plan-limit errors is a wall. dezren39 commented on Nov 17, 2026
state: triaged
task: 17590
lane: any-c
work_kind: task/small-fix
priority: priority/normal — quota routing correctness for the opencode fork; useful and doctrine-backed (Drew, 2026-11-10), but not fleet-stalling breakage, so default band.
effort: effort/m — route layer must consume the measured quota per provider, add the combined wall trigger, and surface a distinct walled-below-1% state, with tests.
kind: kind/feature
Fresh verification this shift (2026-11-17T01:20Z):
Triage verdict: the combined signal in the issue (and Drew's 2026-11-10 refinement comment) is the spec — measured binding-window quota <1% remaining AND quota-class (plan-limit) errors present => wall (or fully deprioritize to effective weight ~0); a lone failure of any class never walls; low quota alone is a warning state only. Release is the existing measured-increase path; never disabled_providers, never a config edit.
First concrete step for the follow-on fix: in packages/core/src/model-route.ts (and the quota read it already consumes), feed the per-provider binding-window remaining fraction into the bench decision alongside the classified failure hint, and add the walled-below-1% availability state.
Acceptance check for the fix: with a provider at <1% on its binding window and quota-class failures present, route decisions show it walled with zero new attempts routed to it; a measured increase on the binding window re-admits it with no config change; Command Code at $0.05 of $10 left reads as walled under this rule. Tests must name their oracle (the combined-signal rule above). dezren39 commented on Nov 17, 2026
state: done (triaged)
task: 17590
lane: any-c
Triage complete for task 17590. Verdict and evidence are in the triage note above (comment 6934849107): task/small-fix, priority/normal, effort/m, kind/feature. The fix is genuinely separate follow-on work, so it is routed as its own packet: task 19434 (small_fix, repo-health-opencode-pilot, dedupe repo-health:v1:fix:developing-today-forks/opencode:issue:2256). Issue #2256 stays OPEN pending that fix. dezren39 commented on Nov 17, 2026 🤖 Agent note · parked — resume brief
- Agent: repo-worker-openchamber (OpenChamber scheduled lane, not-code-d)
- Queue task: 19434 (repo-health-opencode-pilot), origin openchamber-scheduled-lane
- State: parked for 20 min. No code changed. Worktree
~/git/fleet/19434-2256-quota-wall, branch queue/19434-2256-quota-wall, base origin/main.
- Finding: the existing gatheredQuotaWall in
packages/core/src/model-route.ts walls on the full-window threshold only. The combined rule (binding window <1% remaining AND quota-class errors) and the walled-below-1% state are not implemented yet.
dezren39 commented on Nov 17, 2026
Agent note — done (task 19434, lane not-code-b): fixed and merged
Adopted the parked not-code-d worktree/branch (no code had been changed) and implemented the combined-signal wall. PR #2598 MERGED; issue #2256 closed via the PR's Fixes reference.
packages/core/src/model-route.ts: gatheredNearEmptyWall (binding window strictly above 99% used + quotaFailureSignal, fresh reading, reset not yet passed), plantGatheredNearEmptyWall (skip record with the distinct walled-below-1% note, lifted only by a fresh complete reading at/below 99% — the measured-increase path), availability() entry (class quota, reason walled-below-1%: …, resume reset), new health-log kind quota-walled-below-1pct.
packages/core/src/model-resolver.ts: the plant rides the gathered feed (refreshQuotaSkips) next to the full-wall plant.
- Tests (+3 in
model-route.test.ts, oracle = the combined rule): low quota alone walls nothing; 99.5% + quota failure walls until the monthly reset and re-admits at 90%; exactly 99% and generic failures state no wall. Suites: model-route + availability 172 pass, resolver/quota-current/route-log 164 pass, core typecheck clean, oxlint clean. Review disposition: no Codex review ran and no review comments were posted before merge (checked after a wait) — nothing undispositioned.
agent-note:v1 lane=repo-queue-worker-shift-not-code-b task=19434 stage=done outcome=fixed_merged pr=2598
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|