Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

GenericRandomErrorPlugin sends literal @dynamic in Retry-After for non-429 responses

未关闭
#1,905 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@waldekmastykarz 已经在做这个了。

开始于 2026年10月4日。

  • #1909 来自 @waldekmastykarz —— 未关闭

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
csharp
领域
cli, devtools

调研方向

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 内容生成。

描述

work in progress

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

  1. Download the openai-throttling preset: devproxy config get openai-throttling
  2. Start Dev Proxy: devproxy --config-file "~dataFolder/configs/openai-throttling/.devproxy/devproxyrc.json" --failure-rate 100
  3. 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 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

dotnet/dev-proxy 的其他 Issue

查看 dotnet/dev-proxy 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。