-
Notifications
You must be signed in to change notification settings - Fork 80
Labels
Description
Proposal
Extend the GenericRandomErrorPlugin to enhance the handling of the retry-after response header. Currently, the initial value for retry-after is set globally for all responses in the plugin's configuration. This feature proposes supporting a syntax of @dynamic=initialvalue within the response header, enabling the initial retry-after value to be set on a per-response basis.
Motivation
- Allows greater flexibility and realism when simulating errors with varying backoff requirements.
- Developers can configure different endpoints to return different initial
retry-aftervalues, improving test coverage for clients handling these scenarios.
Acceptance Criteria
- The plugin should parse the
@dynamic=initialvaluesyntax from theretry-afterresponse header configuration. - If present, the initial
retry-aftervalue for that response should override the global default for that invocation. - Documentation should be updated with usage examples.
Example
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.0/genericrandomerrorplugin.errorsfile.schema.json",
"errors": [
{
"request": {
"url": "https://models.github.ai/inference/chat/completions",
"method": "POST"
},
"responses": [
{
"statusCode": 429,
"headers": [
{
"name": "Content-Type",
"value": "application/json; charset=utf-8"
},
{
"name": "Retry-After",
"value": "@dynamic=17"
}
],
"body": {
"error": {
"code": "RateLimitReached",
"message": "Rate limit of 15 per 60s exceeded for UserByModelByMinute. Please wait 17 seconds before retrying.",
"details": "Rate limit of 15 per 60s exceeded for UserByModelByMinute. Please wait 17 seconds before retrying."
}
}
}
]
}
]
}In this example, the initial retry-after value will be set to 17 for this response, regardless of the global plugin setting.
Reactions are currently unavailable