[FEATURE]: Claude Agent: per-session cap on provider requests

Aperta
#66,866 1 commento 0 reazioni 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
20/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

The payload names no source files, so start by locating where OpenCode's Claude Agent transport issues provider requests and how its retry hook interacts with the Claude Code subprocess. The issue asks for an opt-in per-session cap that blocks any second model request, including retries, continuation and fallback, before it is sent, and that returns a redacted attempt count. Done means a local fake-provider test showing zero requests during setup and exactly one request for success, a retryable error, an empty reply, and a disconnect after receipt, with default behavior unchanged.

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

Descrizione

area/providers type/feature version/v2
Feature hasn't been suggested before.
  • I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request

Please add an opt-in per-session provider-request cap for Claude Agent. With a cap of one, the transport must stop a second model request before it is sent, including retries, continuation calls, and model or account fallback. If it cannot enforce the cap, reject the session request before sending anything. Return a redacted count of actual attempts and preserve the normal assistant result and existing connection. Leave default behavior unchanged.

In OpenCode 2.4.2 with Claude Code 2.1.330, OpenCode's retry hook can veto host retries, but its HTTP hooks do not see requests from the Claude Code subprocess. The Claude Agent library's maxTurns option limits conversation turns, not provider attempts. A hard cap would let test and quota-sensitive automation make a single model request without risking a hidden retry.

Suggested test: with a local fake provider, verify zero requests during setup and one per case for success, a retryable error, an empty reply, and a disconnect after receipt. Related: #64749 covers rate-limit waiting, not a transport-level cap.

Lingua principale
TypeScript
Stelle
230k
Fork
31.3k
Merge medio
5h 32m
PR unite (30g)
453

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.