Skip to content

fix: restore 60-second cap on Retry-After header values#1924

Open
Oxygen56 wants to merge 1 commit into
openai:mainfrom
Oxygen56:fix/retry-after-cap-1840
Open

fix: restore 60-second cap on Retry-After header values#1924
Oxygen56 wants to merge 1 commit into
openai:mainfrom
Oxygen56:fix/retry-after-cap-1840

Conversation

@Oxygen56

@Oxygen56 Oxygen56 commented Jun 5, 2026

Copy link
Copy Markdown

Restores the 60-second maximum on Retry-After header values.

Fixes #1840

The Retry-After cap was accidentally removed in a chore commit.
This restores it to prevent excessive wait times.

Fixes openai#1840

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Oxygen56 Oxygen56 requested a review from a team as a code owner June 5, 2026 17:36

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4f63d8ebc9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/client.ts
if (timeoutMillis === undefined) {
// If the API asks us to wait a certain amount of time (capped at 60 seconds),
// just do what it says, but otherwise calculate a default
if (!(timeoutMillis && 0 <= timeoutMillis && timeoutMillis < 60 * 1000)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Honor the 60-second Retry-After boundary

When the server returns Retry-After: 60 or Retry-After-Ms: 60000, this condition rejects the value and falls back to the default exponential backoff, which can be well under 60 seconds. That means rate-limit responses that ask clients to wait exactly at the documented cap are retried too early instead of respecting the cap boundary.

Useful? React with 👍 / 👎.

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.

Retry-After 60-second cap silently removed in chore commit, was this intentional?

1 participant