Repository navigation
fix(core): abolish pool-level quota verdicts - #1979
Merged
Merged
Conversation
Drew's ruling (2026-11-07): a pool cannot run out - only models and providers run out. Eligibility is now derived at decision time from per-leg state only: the leaf's own bench, its credential's gate, its provider's skip record, and - via the new ModelRoute.providerQuotaBlocked - its provider's own quota gate, which selection previously reached only through the pool verdict. poolQuotaExhausted, its evidence machinery, the pool-quota-exhausted reason, and the last-resort pool carve-out are deleted; per-leg reasons are preserved verbatim in decision detail. Supersedes #1975.
This was referenced Nov 8, 2026
dezren39
added a commit
that referenced
this pull request
Nov 8, 2026
…skip scoping (#1974, #1976) Rebased onto main after the pool-verdict abolition (#1979): the two commits of this PR replayed as one, with the abolition kept whole. #1974: re-admission is a judgement over the gathered quota snapshot (quota-current.json, refreshed ~15min from the providers own endpoints), never a probe attempt. releaseQuotaSkipsForCurrent/ForSnapshot lift a learned attempt-reported skip only when the freshest reading for the answering model shows its window below full; the sources reset governs over the error-quoted date; no reading, no judgement. refreshQuotaSkips runs beside refreshQuotaGate at every resolution. #1976: a credential-less quota answer plants a model-scoped skip naming only the answering target; provider scope requires a second distinct target of the provider answering quota while the first hold stands (QUOTA_SKIP_CORROBORATION_SOURCES). Learned skips report quota-skip in decision detail; user-skip is the operators own override only. Rebase reconciliation: poolQuotaExhausted and its evidence machinery (quotaEvidence/staleGateEvidence/independentQuotaGate) stay deleted per the abolition — per-leg and per-provider state only, no pool facts. The one #1978 test that asserted the deleted verdict was rewritten to assert the surviving behavior (one family out stays model-scoped; two families promote to provider scope), and the abolitions per-leg test was updated for the #1976 scoping it now composes with.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1974, Refs #1976
Drew's ruling (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."
What changes
ModelRoute.poolQuotaExhaustedand its evidence machinery (quotaEvidence,poolOf,poolIDOf,independentQuotaGate,POOL_QUOTA_LEAVES,quotaBench) are deleted. No stored or synthesized pool-level quota fact remains, and thepool-quota-exhaustedexclusion reason is gone.credentialQuotaBlocked), its provider's skip record (skipped), or — new — its provider's own quota gate viaModelRoute.providerQuotaBlocked, the provider-scope mirror ofcredentialQuotaBlocked(known-full snapshot; threshold balance hold judged under the requesting Location; retained reactive timed gate). Selection previously reached the provider gate only through the pool verdict; the resolver never consulted it directly.provider-quota-known-full-until:<reset>), preserving per-leg reasons verbatim in decision detail. Gates beat probes exactly as before, now judged per leg: one leaf's state never excludes another leaf, and a leaf's own independent provider gate still outranks its own due probe (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/fix(core): let due bench probes recover quota-exhausted pools #1473 doctrine, per-leg).Tests
providerQuotaBlocked) instead of pool pull-out; after a restart, the durable provider record carries the judgement throughskipped()until the next fed snapshot.bun test test/model-route.test.ts test/model-resolver.test.ts: 219 pass, 0 fail. Fullpackages/coresuite: 8250 pass, 8 fail — the identical 8 failures reproduce on unmodified main (native embeddings sidecar, DatabaseMigration schema drift, test-environment isolation, models.dev variant spelling, one ConfigProviderPlugin case), so no regressions. Typecheck clean.Supersedes #1975, which kept the pool verdict and only stopped bench evidence counting toward it once gates re-judged clear — the wrong direction under the ruling. #1975 is closed with the ruling quoted.