Skip to content

Resolve @dynamic Retry-After for any status code in GenericRandomErrorPlugin - #1909

Merged
garrytrinder merged 3 commits into
dotnet:mainfrom
waldekmastykarz:waldekmastykarz-fix-dynamic-retry-after-non-429
Oct 5, 2026
Merged

garrytrinder merged 3 commits into
dotnet:mainfrom
waldekmastykarz:waldekmastykarz-fix-dynamic-retry-after-non-429

Conversation

@waldekmastykarz

Copy link
Copy Markdown
Collaborator

Closes #1905

GenericRandomErrorPlugin only resolved @dynamic / @dynamic=N in the Retry-After header for 429 responses, so 503/529 errors (used by presets like openai-throttling and anthropic-throttling) sent the literal @dynamic value.

Changes:

  • Resolve @dynamic in Retry-After regardless of status code and register the request with RetryAfterPlugin
  • Match the Retry-After header name case-insensitively
  • Add an integration test for a 503 with @dynamic=7
…rPlugin

Previously @dynamic was only resolved for 429 responses, so 503/529
errors sent the literal '@dynamic' value. Closes dotnet#1905

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 3, 2026 11:58
@waldekmastykarz
waldekmastykarz requested a review from a team as a code owner October 3, 2026 11:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Core registration and case-insensitive matching behavior need direct regression coverage.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
What changed in this PR

Extends dynamic Retry-After handling to non-429 responses.

Changes:

  • Resolves dynamic headers for any status code with case-insensitive matching.
  • Adds 503 integration coverage.
File Description
GenericRandomErrorPlugin.cs Broadens dynamic header handling.
BehaviorPluginsIntegrationTests.cs Tests dynamic 503 response headers.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Use mixed-case header name to cover case-insensitive lookup and verify
RetryAfterPlugin throttles an immediate retry.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The implementation matches the issue requirements and has focused integration coverage.

Review effort: Balanced
Findings: None

Resolved since last review (2)
@garrytrinder
garrytrinder enabled auto-merge (squash) October 5, 2026 08:53
@garrytrinder
garrytrinder merged commit e9d0649 into dotnet:main Oct 5, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants