GenericRandomErrorPlugin sends literal @dynamic in Retry-After for non-429 responses
维护者通常 1 天内回复
评估
调研方向
Start in DevProxy.Plugins/Behavior/GenericRandomErrorPlugin.cs at the status-code check described in the issue, then inspect how RetryAfterPlugin is registered. Reproduce with the openai-throttling preset and confirm that dynamic Retry-After values are resolved for non-429 responses and that the resulting header is numeric.
由索引模型根据 Issue 内容生成。
描述
Description
GenericRandomErrorPlugin only replaces @dynamic (and @dynamic=N) in the Retry-After header when the error response has status code 429. For any other status code, Dev Proxy sends the literal value @dynamic to the client.
APIs also send Retry-After on other status codes. For example, OpenAI returns 503 server_is_overloaded with Retry-After, and Anthropic returns 529 overloaded_error.
Source: DevProxy.Plugins/Behavior/GenericRandomErrorPlugin.cs, the if (error.StatusCode == (int)HttpStatusCode.TooManyRequests && ...) check.
Steps to reproduce
- Download the
openai-throttlingpreset:devproxy config get openai-throttling - Start Dev Proxy:
devproxy --config-file "~dataFolder/configs/openai-throttling/.devproxy/devproxyrc.json" --failure-rate 100 - Send requests until you get a 503:
curl -ikx http://127.0.0.1:8000 https://api.openai.com/v1/models
Expected behavior
HTTP/1.1 503 Service Unavailable
Retry-After: 5
Actual behavior
HTTP/1.1 503 Service Unavailable
Retry-After: @dynamic
Clients can't parse the header, so they fall back to their own backoff. RetryAfterPlugin doesn't check whether the app waited.
Affected presets
openai-throttling(503)anthropic-random-errors(529)anthropic-throttling(529)api-degradation-scenarios(503)webhook-delivery-resilience(503)
Proposed fix
Resolve @dynamic in the Retry-After header for any status code, and register the request with RetryAfterPlugin whenever the response has a @dynamic Retry-After header.
The other option is to keep the current behavior, show a warning when @dynamic is used on a status other than 429, and change the presets to use a number.
- 主要语言
- C#
- 星标
- 833
- 派生
- 90
- 平均合并
- 16 小时 44 分钟
- 30 天内合并 PR
- 40
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
dotnet/dev-proxy 的其他 Issue
-
LanguageModelRateLimitingPlugin returns a billing error (insufficient_quota) instead of a rate limit error可能已有人在做 @waldekmastykarz 于 1 天前认领。 未关闭work in progress
难度 2/5 1-3 小时 新手友好度 82/100
dotnet/dev-proxy#1911 · 已指派 1 人 ·
维护者通常 1 天内回复
-
难度 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 天内回复
-
MockStdioResponsePlugin: @stdin.body.id placeholder fails to resolve when messages arrive back-to-back after an id-less message可能重新可做 @garrytrinder 于 84 天前认领,目前没有进行中的 PR。 未关闭
dotnet/dev-proxy#1757 · 1 个 reaction · 已指派 2 人 ·
维护者通常 1 天内回复
相似的 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 天内回复