Repository navigation
Closed
Labels
effort/lLarge: multi-day or open-ended; expect staged check-insLarge: multi-day or open-ended; expect staged check-insexpediteImportant - do this very soon, before anything not expeditedImportant - do this very soon, before anything not expeditedkind/enhancementNew feature or requestNew feature or requestmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedIntake review done: acceptance criteria, links, and normalized labels addedpriority/highImportant and time-sensitiveImportant and time-sensitivequeue/parkedQueue task is parked (waiting on CI, time, or an event)Queue task is parked (waiting on CI, time, or an event)status/parkedDeliberately paused with a recorded resume conditionDeliberately paused with a recorded resume conditionwork/assignedAn agent holds this item via the queue (claimed task)An agent holds this item via the queue (claimed task)
Description
Drew's directive (2026-10-30): ensure that OpenCode — and OpenChamber where it surfaces routes/models — removes a model/target from rotation when it repeatedly returns errors, for an increasing amount of time per recurrence, or until the time the error is expected to be resolved when that is known.
Error classes in scope (all of them)
- Rate limit (429, with or without Retry-After)
- Billing / funds (402, insufficient credits, payment-required class)
- Quota exhaustion (usage-limit errors naming a reset time)
- Auth/attestation failures
- Upstream 5xx and timeouts / first-token failures
- Any other repeated provider error class
Required behavior
- Repeated errors of any class take the model/target out of rotation — not retried on a fixed short interval forever.
- The removal duration ESCALATES with recurrence (increasing backoff), capped sensibly.
- When the error carries an expected resolution time (quota reset, Retry-After), the removal lasts until that time instead — and the target is restored automatically when it passes (or when a fresh quota read shows headroom).
- Restoration is automatic and probed, not permanent: a recovered model re-enters rotation without operator action.
- The behavior is consistent across both surfaces: the OpenCode router (packages/core model-route) and any OpenChamber-side model/route handling, so a model removed in one is not immediately re-offered by the other.
Existing partial coverage to verify against (do not duplicate blindly)
- feat(core): route health cooldown never escalates — a permanently failing target is retried every 60s forever #823 (closed): route health cooldown escalation.
- fix(routes): thread the credential dimension through restore, escalation, ranking, rate-limit holds and catalog headers (PR #854 follow-up) #870 (closed): rate-limit holds threaded through the credential dimension.
- router: auto-disable providers at 100% quota until a fresh read shows headroom (cline-pass, commandcode, go) #984 + PR feat(core): gate quota-exhausted pools until their stated reset (#984) #991 (merged): quota-exhausted pools gated until their stated reset.
Acceptance criteria
- An audit table (in the PR or a linked comment) listing each error class above × where its removal/escalation/reset behavior lives, with the gaps found.
- Every gap closed: billing errors and non-quota repeated errors escalate like quota/rate-limit ones; openchamber surface checked and aligned.
- Tests demonstrating: repeated 402s remove the target with escalating cooldown; a quota error naming a reset restores the target at the reset; a recovered target re-enters rotation.
Metadata
Metadata
Assignees
Labels
effort/lLarge: multi-day or open-ended; expect staged check-insLarge: multi-day or open-ended; expect staged check-insexpediteImportant - do this very soon, before anything not expeditedImportant - do this very soon, before anything not expeditedkind/enhancementNew feature or requestNew feature or requestmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedIntake review done: acceptance criteria, links, and normalized labels addedpriority/highImportant and time-sensitiveImportant and time-sensitivequeue/parkedQueue task is parked (waiting on CI, time, or an event)Queue task is parked (waiting on CI, time, or an event)status/parkedDeliberately paused with a recorded resume conditionDeliberately paused with a recorded resume conditionwork/assignedAn agent holds this item via the queue (claimed task)An agent holds this item via the queue (claimed task)
Activity
dezren39 commentedon Oct 30, 2026
Triage evidence — issue-sweep-rotating (feeder), 2026-10-30
Verified fresh against current main
d2af8df514(local clone at that exact SHA, code reading only). This issue is not already covered — the audit-shaped remainder below is real:Already in place in the OpenCode router (partial coverage, confirmed by reading):
packages/core/src/model-route.tsbench()— every failure that reachesModelRoute.faileddoubles its bench per consecutive failure (base * 2^(n-1), capped at 1 day); quota and auth failures start from the longquotaCooldownMsbench; a stated retry-after is believed as-is and never multiplied.observeQuotaFailure(model-route.ts:532, PR feat(core): gate quota-exhausted pools until their stated reset (#984) #991 / router: auto-disable providers at 100% quota until a fresh read shows headroom (cline-pass, commandcode, go) #984 reactive half) gates a pool until its stated reset.packages/ai/src/provider-error.ts:262classifies HTTP 402 and theQUOTA_CODESset (insufficient_quota,billing_error,creditlimitexceeded, …) asQuotaExceededError, so those take the quota path throughfailureHint(packages/core/src/session/runner/step.ts:135).Gaps the audit still has to close (found this run):
step.ts:440(insufficient credits|quota exhausted|usage limit exceeded|reached your .* limit) get only the ordinary failure bench — no quota-length hold, no reset-aware gate. Billing coverage is therefore classification-dependent, not class-wide.observeCredentialQuota(model-route.ts:495) has no production caller (see router: auto-disable providers at 100% quota until a fresh read shows headroom (cline-pass, commandcode, go) #984 triage, comment 6534885631), so a target known-full from regular reads is not removed before its first failure of a session, for any error class.credentialQuotaBlocked/ quota-gated equivalent; only UI routing-pool fields). Whether OpenChamber re-offers a model the router has benched is unchecked — this is the set remainder owed in developing-today/openchamber, to be triaged from this origin issue by a later feeder run in that repo (recorded as a SET-REMAINDER entry in the opencode backlog; no per-repo issue filed).Done looks like: the acceptance audit table (error class × removal/escalation/reset location) posted on this issue, every gap in it closed or explicitly dispositioned, and the three acceptance tests (repeated 402s escalate; quota error naming a reset restores at the reset; recovered target re-enters rotation).
Enqueueing as a triage packet to
repo-health-opencode-pilot; the queue lane owns the audit and any implementation routing.dezren39 commentedon Oct 30, 2026
agent-note:v1
state: queued
Agent: issue-sweep-rotating (triage feeder)
Session/ID: issue-sweep-rotating run 2026-10-30 17:24 CDT
Found via: feeder triage (evidence comment 6534944157)
Task: Enqueued triage packet to repo-health-opencode-pilot as task 4019 (dedupe repo-health:v1:triage:developing-today/opencode:issue:1014; packet hidden_files/packet-opencode-1014-triage.json)
Expectation: queue lane produces the error-class audit table and routes each gap. Cross-repo SET-REMAINDER: developing-today/openchamber surface alignment is owed and is triaged from this origin issue — no per-repo issue filed. Feeder took no implementation action.
dezren39 commentedon Oct 30, 2026
agent-note:v1
state: in-progress
Agent: repo-worker-opencode (OpenChamber scheduled lane)
Session/ID: ses_e5e70f5617bffeD2NizFCNQRVE
Found via: repo-health-opencode-pilot task 4019
Task: Triage issue #1014: all-error-class rotation audit — removal/escalation gaps by class
Expectation: Produce the acceptance audit table, disposition or route each gap, verify acceptance tests / behaviour, align cross-repo set remainder with developing-today/openchamber.
dezren39 commentedon Oct 30, 2026
Audit table — all-error-class rotation (queue task 4019, main
be8dd99965)Verified fresh against
be8dd99965(fast-forwarded from feederd2af8df514; only oauth/model-list changes in between, nothing in the router path). Prior coverage confirmed: #823 closed (escalating cooldown), #870 closed (credential threading), PR #991 merged 2026-10-30 (reactive quota gate), #984 still OPEN (proactive auto-disable).ModelRoute.failedviastep.ts:550withfailureHint(step.ts:135);bench()(model-route.ts:337) setscooldownUntilretryAfterMsbelieved as-is, never multiplied (model-route.ts:350); without it, doubles perconsecutiveFailures, cap 1 day (model-route.ts:352,MAX_COOLDOWN_MS)observeRateLimit/limitedUntilplus bench expiry viarecover()(model-route.ts:269); success incompleted()(model-route.ts:586) resets count and benchcooldownMs, cap 1 daycompleted()resetQUOTA_CODES:insufficient_quota,billing_error,creditlimitexceeded, …)provider-error.ts:261→QuotaExceeded→quota:truehint → long first bench (quotaCooldownMs) +observeQuotaFailuregate (step.ts:441,model-route.ts:532)model-route.ts:514)credentialQuotaBlocked,model-route.ts:569); fresher below-limit snapshot re-admits early; success resets escalationprovider-error.ts:302→InvalidRequest(non-retryable,isRetryable:false) → post-streamrouteFailurefalse → noModelRoute.failedbench on the post-stream path; mid-stream pre-output errors still bench viastep.ts:281observeQuotaFailureunless thestep.ts:440exhaustion regex matches (insufficient credits|quota exhausted|usage limit exceeded|reached your .* limit); outside those 4 phrases, no reset-aware gateretryAfterMsfromfailureHintbelievedobserveQuotaFailureuntilresetAt(step.ts:448); re-admit at reset or on fresher healthy snapshotAUTH_CODES, org-disabled)auth:truehint (step.ts:151) → long first benchrouteFailureincludes Auth so it benches post-streamProviderInternalretryAfterMsbelieved when statedTransport/Timeout(non-retryable, no bench viarouteFailure) BUT first-token timeout synthesizes a Timeout error pre-output and the hedge/escalation path applies;slow()(model-route.ts:405) cools repeatedly-slow targets;giveUps/escalates(model-route.ts:454) races next targetcooldownMs; failure doubling where appliedUnknownProvider,Transportw/o response)ModelRoute.failedpost-streamrecover(), resets only on success (model-route.ts:335)InvalidRequestnon-overflow,ContentPolicy,NoRoute,UnsupportedOperation)model-route.ts:381)observeCredentialQuota(model-route.ts:495) +credentialQuotaBlockedgate exist and are testedpool-health.jsis explicitly read-only/advisory ("never moves a session or changes a weight by itself");route-wait.jsonly reads OpenCoderoute_healthcooldown-start history for wait estimates; nocredentialQuotaBlocked/gate consumption foundDispositions
step.ts:440exhaustion regex (and consider a billing-text arm inprovider-error.tsQUOTA_TEXT/400-path, e.g.insufficient credits|billing|payment required|credit limit|out of credits) so text-only billing classifies quota-side: long first bench +observeQuotaFailuregate instead of sometimes-no-bench. Suggested new queue task; not implemented in this triage (no code changed here).observeCredentialQuotawiring → router: auto-disable providers at 100% quota until a fresh read shows headroom (cline-pass, commandcode, go) #984 / packet 4017.Acceptance tests pinned (all exist today, no new tests written here)
packages/core/test/model-route.test.ts:271("an exhausted quota outlasts an ordinary failure", quota=true is the 402 path) +:280("repeated failures double the bench, count survives expiry") +:304(auth/long-base escalation shape). A literal 402-status test would live inpackages/aiclassification + this bench pair; D1 follow-up should add it.packages/core/test/model-route-credential.test.ts:211("credentialed exhaustion gates only that credential until the stated reset") +:220(fallback hold + 30d cap) +:229(credential-less provider skip until reset).model-route.test.ts:294("success resets escalation") +model-route-credential.test.ts:160("fresher good read re-admits before reset") +:145("blocked until reset, then re-admitted with health record"); expiry path viarecover()(model-route.ts:269) covered by:280(cooldownUntil0 after expiry).Worktree
~/git/fleet/4019, branchqueue/4019-1014-error-class-auditcreated, no commits (triage-only, read +gh).197 remaining items
dezren39 commentedon Nov 2, 2026
🤖 Agent note · picked up
queue/6188-1014-dynamic-pull-out, laptop worktree/home/user/git/fleet/6188-1014-dynamic-pull-outdezren39 commentedon Nov 2, 2026
🤖 Agent note · parked
4794119cf576ef018f7c9897bc3c2b3c2da7de66, basemain, and authored by Drew (dezren39). CodeRabbit is neutral; a Codex review is present. The existing branch/worktree isqueue/6188-1014-dynamic-pull-outat/home/user/git/fleet/6188-1014-dynamic-pull-out.Merge pull request #1384 from developing-today/queue/6188-1014-dynami…
dezren39 commentedon Nov 2, 2026
PR3 merged: PR #1384 (merge commit f7b4c02, 2026-11-02T12:45:42Z) — pool-shaped quota pull-out + any-error-class escalating bench.
Independent verification before merge (fresh worktree at the PR head 4794119, deps installed from scratch — not the worker's own run):
bun run typecheckin packages/core: clean (exit 0)ModelRoute.failedfor terminal non-retryable classes while the current-request failover gate is unchanged.#1014 stays open: the runner-policy packet (#1379, task 6191, queued) and the CodeRabbit follow-ups (#1380, task 6192, parked) remain, per the PR3 body.
dezren39 commentedon Nov 2, 2026
Reopening: #1014 auto-closed 4 seconds after the PR #1384 merge (closed 2026-11-02T12:45:46Z, reason COMPLETED) — the PR body and the task-6188 handoff both record explicitly that PR3 does not close this issue. The runner-policy packet (#1379) and the CodeRabbit follow-ups (#1380) are still outstanding, so #1014 stays open until they land.