plugins: http.request quota refusals bypass session.retry

Aperta
#65,198 1 commento 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
18/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
devtools

Direzione di ricerca

Start with the session hook wrapper in packages/plugin/src/promise/adapter.ts, where the callback is wrapped in Effect.promise, and check how a thrown NativeVaultQuotaPolicyError escapes it. The expected change is a supported way for a hook to return a local provider error so session.retry can fall back. Done means a quota refusal reaches session.retry and the turn continues on the fallback provider. The issue is a maintainer-level design question about the plugin API, so it is not a good first contribution.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area/plugins platform/linux type/feature version/v2
Description

When the Claude OAuth pool is already out of quota, anthropic-auth throws NativeVaultQuotaPolicyError from http.request before sending the model request. OpenCode logs Failed to drain Session, records an unknown error, and never calls session.retry. I reproduced this twice in the main session and once in a subagent. Both had a working non-Anthropic fallback.

Failed to drain Session
NativeVaultQuotaPolicyError: No Claude account has room for this request (weekly limit or your quota floor).

OpenCode wraps the session hook callback in Effect.promise. The anthropic-auth diagnosis confirms that the plugin has no supported way to refuse the request locally as a provider error.

Expected: let the hook return a local error response without sending the request. Pass it through the normal provider error handling so session.retry can switch providers and continue the same turn.

Plugins

@cortexkit/opencode-anthropic-auth 2.16.2, oh-my-opencode-slim 3.0.7 (a052f07a).

OpenCode version

2.3.2

Steps to reproduce
  1. Configure the Anthropic OAuth pool and a non-Anthropic fallback.
  2. With all eligible Claude accounts already out of quota, send a new prompt using Claude.
  3. The turn stops without trying the fallback. The same happens when a subagent starts on Claude.
Operating System

Ubuntu 24.04.5 LTS, arm64.

Terminal

OpenCode TUI in tmux.

Lingua principale
TypeScript
Stelle
227k
Fork
30.7k
Merge medio
3h 57m
PR unite (30g)
484

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di anomalyco/opencode

Tutte le issue di anomalyco/opencode

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.