Return rate limit error instead of quota error from LanguageModelRateLimitingPlugin - #1912
Open
waldekmastykarz wants to merge 2 commits into
Open
waldekmastykarz wants to merge 2 commits into
waldekmastykarz wants to merge 2 commits into
Conversation
…eModelRateLimitingPlugin. Closes dotnet#1911 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new error message underreports consumed tokens when usage exceeds the configured limit.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Changes the default language-model throttle response to a retryable OpenAI rate-limit error, addressing #1911.
Changes:
- Reports the model, token limit, usage, and retry delay.
- Adds integration coverage for the throttle response.
- Updates documentation while preserving custom responses.
| File | Description |
|---|---|
| skills/dev-proxy/references/test-llm-apps.md | Updates error examples and explains custom quota errors. |
| DevProxy.Plugins/Behavior/LanguageModelRateLimitingPlugin.cs | Returns rate-limit errors with token and retry details. |
| DevProxy.Integration.Tests/BehaviorPluginsIntegrationTests.cs | Tests the default throttle response. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…ttle message Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes #1911
When throttling with
whenLimitExceeded: "Throttle",LanguageModelRateLimitingPluginreturned OpenAI'sinsufficient_quotabilling error, which tells clients to stop retrying. It now returns OpenAI's tokens-per-minute rate limit error so clients back off and retry:{ "error": { "message": "Rate limit reached for gpt-4o on tokens per min (TPM): Limit 10, Used 10. Please try again in 299s.", "type": "tokens", "param": null, "code": "rate_limit_exceeded" } }retry-afterheader).whenLimitExceeded: "Custom"is unchanged, for anyone who wants to simulate a quota error on purpose.