LanguageModelRateLimitingPlugin returns a billing error (insufficient_quota) instead of a rate limit error
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
DevProxy.Plugins/Behavior/LanguageModelRateLimitingPlugin.cs から始め、想定されるエラー構造を pnp/proxy-samples の openai-throttling プリセットと比較します。デフォルトの throttle 応答が type "tokens" と code "rate_limit_exceeded" を使用し、プラグインのトークンカウンターを含み、Custom で引き続きクォータエラーをシミュレートできれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- C#
- スター
- 833
- フォーク
- 90
- 平均マージ
- 16時間 44分
- マージ済み PR(30日)
- 40
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
dotnet/dev-proxy のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
config get doesn't print the start command for presets with a .devproxy folder対応中かも @waldekmastykarz が 1 日前に担当しました。 オープンwork in progress
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
dotnet/dev-proxy#1906 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
GenericRandomErrorPlugin sends literal @dynamic in Retry-After for non-429 responses対応中かも @waldekmastykarz が 1 日前に担当しました。 オープンwork in progress
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
dotnet/dev-proxy#1905 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
MockStdioResponsePlugin: @stdin.body.id placeholder fails to resolve when messages arrive back-to-back after an id-less message再び着手できるかも @garrytrinder が 84 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
dotnet/dev-proxy#1757 · リアクション 1 件 · 担当者 2 名 ·
メンテナーはふだん 1 日以内に返信
dotnet/dev-proxy の issue をすべて見る
似ている issue
-
test
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
NethermindEth/nethermind#14274 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
area:frontend bug FE P3
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
klasolsson81/jobbliggaren#2023 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
shimat/opencvsharp#2154 ·
メンテナーはふだん 1 日以内に返信
-
subsystem: UI
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Open-Systems-Pharmacology/PK-Sim#3812 ·
メンテナーはふだん 1 日以内に返信