Skip to content

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

Open
waldekmastykarz wants to merge 2 commits into
dotnet:mainfrom
waldekmastykarz:waldekmastykarz-fix-dynamic-retry-after-non-429
Open

waldekmastykarz wants to merge 2 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.

Comment thread DevProxy.Integration.Tests/BehaviorPluginsIntegrationTests.cs Outdated
Comment thread DevProxy.Integration.Tests/BehaviorPluginsIntegrationTests.cs
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>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants