Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

LanguageModelRateLimitingPlugin returns a billing error (insufficient_quota) instead of a rate limit error

Aperta Adatta ai principianti
#1,911 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@waldekmastykarz ci sta già lavorando.

Dal 4/10/2026.

  • #1912 di @waldekmastykarz — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
82/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
devtools

Direzione di ricerca

Inizia da DevProxy.Plugins/Behavior/LanguageModelRateLimitingPlugin.cs e confronta la struttura dell'errore prevista con il preset openai-throttling in pnp/proxy-samples. Il lavoro è terminato quando la risposta di throttle predefinita usa type "tokens" e code "rate_limit_exceeded", include i contatori dei token del plugin e Custom può ancora simulare un errore di quota.

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

Descrizione

work in progress

Description

When LanguageModelRateLimitingPlugin throttles a request with whenLimitExceeded: "Throttle" (the default), it returns a 429 with this body (DevProxy.Plugins/Behavior/LanguageModelRateLimitingPlugin.cs):

{
  "error": {
    "message": "You exceeded your current quota, please check your plan and billing details.",
    "type": "insufficient_quota",
    "code": "insufficient_quota"
  }
}

That's the body OpenAI uses for a billing or quota error, which means "stop, retrying won't help". OpenAI's docs say: "Retrying billing, spend, or quota errors won't restore API access." (Error codes)

The plugin simulates a token rate limit, which means "wait and retry". So an app that handles OpenAI errors correctly does the wrong thing under Dev Proxy:

  • It stops retrying and shows "out of credits", when it should back off and retry.
  • Its rate limit branch (rate_limit_exceeded) never runs, so the test doesn't cover the code path the plugin is meant to test.

Steps to reproduce

  1. Enable LanguageModelRateLimitingPlugin with a low promptTokenLimit for https://api.openai.com/*.
  2. Send OpenAI requests until the limit is exceeded.
  3. Inspect the 429 body.

Expected behavior

A rate limit error that matches what OpenAI returns when you exceed tokens per minute, for example:

{
  "error": {
    "message": "Rate limit reached for <model> in organization <org> on tokens per min (TPM): Limit <limit>, Used <used>, Requested <requested>. Please try again in <n>s.",
    "type": "tokens",
    "param": null,
    "code": "rate_limit_exceeded"
  }
}

The openai-throttling preset in pnp/proxy-samples already uses this shape.

Actual behavior

The 429 body says insufficient_quota, which clients treat as a billing error.

Proposed fix

Change the default throttle body to rate_limit_exceeded with type: "tokens", and include the token numbers from the plugin's counters in the message. Keep whenLimitExceeded: "Custom" for anyone who wants to simulate a quota error on purpose.

Lingua principale
C#
Stelle
833
Fork
90
Merge medio
16h 44m
PR unite (30g)
40

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 dotnet/dev-proxy

Tutte le issue di dotnet/dev-proxy

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.