LanguageModelRateLimitingPlugin returns a billing error (insufficient_quota) instead of a rate limit error
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 82/100
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
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
- Enable
LanguageModelRateLimitingPluginwith a lowpromptTokenLimitforhttps://api.openai.com/*. - Send OpenAI requests until the limit is exceeded.
- 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
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di dotnet/dev-proxy
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
config get doesn't print the start command for presets with a .devproxy folderForse già presa @waldekmastykarz l’ha presa 1 giorno fa. Apertawork in progress
Difficoltà 2/5 1-3 ore Idoneità per principianti 25/100
dotnet/dev-proxy#1906 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
GenericRandomErrorPlugin sends literal @dynamic in Retry-After for non-429 responsesForse già presa @waldekmastykarz l’ha presa 1 giorno fa. Apertawork in progress
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
dotnet/dev-proxy#1905 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
MockStdioResponsePlugin: @stdin.body.id placeholder fails to resolve when messages arrive back-to-back after an id-less messageForse di nuovo libera @garrytrinder l’ha presa 84 giorni fa e non c’è nessuna pull request aperta. Aperta
dotnet/dev-proxy#1757 · 1 reazione · 2 assegnatari ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di dotnet/dev-proxy
Issue simili
-
[C#]:主页联网更新的提示投稿横幅指向错误Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
PCL-Community/PCL-CE#3652 ·
I maintainer di solito rispondono entro 1 giorno
-
bug effort:S P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
nightscout/nocturne#2012 ·
I maintainer di solito rispondono entro 1 giorno
-
area:frontend bug FE P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
klasolsson81/jobbliggaren#2010 ·
I maintainer di solito rispondono entro 1 giorno
-
[aw] Upgrade availableApertaagentic-workflows untriaged
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
area: homeblaze type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
RicoSuter/Namotion.Interceptor#630 ·
I maintainer di solito rispondono entro 1 giorno