Skip to content

fix(models): reject non-finite Retry-After delays - #4558

Closed
sylvesterkaczmarek wants to merge 2 commits into
openai:mainfrom
sylvesterkaczmarek:fix/retry-after-nonfinite
Closed

fix(models): reject non-finite Retry-After delays#4558
sylvesterkaczmarek wants to merge 2 commits into
openai:mainfrom
sylvesterkaczmarek:fix/retry-after-nonfinite

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown
Contributor

This pull request prevents malformed provider retry headers from producing an infinite runner-managed retry delay.

parse_retry_after_ms() and the numeric branch of parse_retry_after_value() now require parsed delays to be both finite and non-negative. Values such as Infinity, -Infinity, and NaN therefore return None instead of propagating into retry advice and potentially reaching asyncio.sleep() as an unbounded delay.

All valid finite Retry-After and Retry-After-Ms values retain their current behavior, including HTTP-date parsing. Focused regression coverage checks the non-finite forms for both numeric header formats and finite control values.

This pull request resolves #4555.

@seratch seratch added the wontfix This will not be worked on label Aug 21, 2026
@seratch seratch closed this Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

retry parsing accepts infinite Retry-After delays

2 participants