Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#1,911 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@waldekmastykarz がすでに取り組んでいます。

2026年10月4日 から。

  • #1912 @waldekmastykarz による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
csharp
領域
devtools

調査の方向性

DevProxy.Plugins/Behavior/LanguageModelRateLimitingPlugin.cs から始め、想定されるエラー構造を pnp/proxy-samples の openai-throttling プリセットと比較します。デフォルトの throttle 応答が type "tokens" と code "rate_limit_exceeded" を使用し、プラグインのトークンカウンターを含み、Custom で引き続きクォータエラーをシミュレートできれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
C#
スター
833
フォーク
90
平均マージ
16時間 44分
マージ済み PR(30日)
40

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

dotnet/dev-proxy のほかの issue

dotnet/dev-proxy の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。