Skip to content

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

Description

@PurpleMyst

Confirm this is a Node library issue and not an underlying OpenAI API issue

  • This is an issue with the Node library

Describe the bug

In commit 583240f (chore: codegen related update), the 60-second cap on Retry-After headers was silently removed. This is a significant behavior change that affects production applications.

Before (had cap):

if (!(timeoutMillis && 0 <= timeoutMillis && timeoutMillis < 60 * 1000)) {
  timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
}

After (no cap):

if (timeoutMillis === undefined) {
  timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
}

The SDK now respects any Retry-After value the server provides, with no upper limit:

  • Retry-After: 300 → waits 5 minutes
  • Retry-After: 3600 → waits 1 hour

Previously, values exceeding 60 seconds would fall back to calculated exponential backoff (capped at 8 seconds).

Questions:

  1. Was this change intentional?
  2. If so, what's the rationale for removing the cap?
  3. Should there be a configurable maximum retry delay, similar to how maxRetries is configurable?

To Reproduce

  1. API returns 429 with Retry-After: 600 (10 minutes)
  2. SDK waits the full 10 minutes before retrying
  3. Previously, it would have used calculated backoff (~8 seconds)

Code snippets

const client = new OpenAI();

// When API returns 429 with Retry-After: 600
// SDK now waits full 10 minutes (previously: ~8 seconds with backoff)
const response = await client.chat.completions.create({ ... });

OS

macOS / Windows / Linux (all affected)

Node version

Node v25.9.0

Library version

openai v6.34.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions