Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Cerrado Apto para principiantes
#1,911 0 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@waldekmastykarz ya está trabajando en esto.

Desde el 4/10/2026.

  • #1912 de @waldekmastykarz — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
82/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
csharp
Área
devtools

Línea de trabajo

Comienza en DevProxy.Plugins/Behavior/LanguageModelRateLimitingPlugin.cs y compara la estructura de error esperada con el preset openai-throttling en pnp/proxy-samples. Se considera terminado cuando la respuesta de throttle predeterminada usa type "tokens" y code "rate_limit_exceeded", incluye los contadores de tokens del plugin y Custom aún puede simular un error de cuota.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
C#
Estrellas
833
Forks
90
Merge medio
18 h 41 min
PR fusionados (30 d)
45

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de dotnet/dev-proxy

Todos los issues de dotnet/dev-proxy

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.