Skip to content

Honor Retry-After headers in failed Responses events - #50418

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/46433c2e9e6d5e804211ef96950fadd70e322b49
Oct 2, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/46433c2e9e6d5e804211ef96950fadd70e322b49

Conversation

@copyberry

@copyberry copyberry Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Honor Retry-After headers in failed Responses events

Why

Streamed response.failed events can carry retry advice in response.error.headers. Ignoring it loses server-provided delays or uses a conflicting delay from a rate-limit message.

What changed

  • Parse nested Retry-After headers using the existing HTTP header validation and retry parser, and preserve them for rate-limit, overload, and generic retryable failures.
  • Prefer valid headers over rate-limit message advice, falling back to the message when the header is absent or invalid. Keep terminal error classifications unchanged.
  • Reject unrepresentable plaintext retry durations without panicking.

Testing

Add regression coverage for header precedence, validation, and terminal errors, plus retry-loop coverage for SSE sampling, remote compaction, and WebSocket failures.

## Why

Streamed `response.failed` events can carry retry advice in `response.error.headers`. Ignoring it loses server-provided delays or uses a conflicting delay from a rate-limit message.

## What changed

- Parse nested `Retry-After` headers using the existing HTTP header validation and retry parser, and preserve them for rate-limit, overload, and generic retryable failures.
- Prefer valid headers over rate-limit message advice, falling back to the message when the header is absent or invalid. Keep terminal error classifications unchanged.
- Reject unrepresentable plaintext retry durations without panicking.

## Testing

Add regression coverage for header precedence, validation, and terminal errors, plus retry-loop coverage for SSE sampling, remote compaction, and WebSocket failures.

GitOrigin-RevId: 46433c2e9e6d5e804211ef96950fadd70e322b49
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/46433c2e9e6d5e804211ef96950fadd70e322b49 branch from f11d9e2 to 44dd77b Compare October 2, 2026 20:19
@copyberry
copyberry Bot merged commit 44dd77b into main Oct 2, 2026
1 check passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/46433c2e9e6d5e804211ef96950fadd70e322b49 branch October 2, 2026 20:19
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 2, 2026
@tyemirov
tyemirov deployed to issue-triage October 2, 2026 20:20 — with GitHub Actions Active
@tyemirov
tyemirov deployed to issue-triage October 2, 2026 20:20 — with GitHub Actions Active
@tyemirov
tyemirov deployed to issue-triage October 2, 2026 20:20 — with GitHub Actions Active
@roeyjos
roeyjos deployed to issue-triage October 2, 2026 20:21 — with GitHub Actions Active
@roeyjos
roeyjos deployed to issue-triage October 2, 2026 20:21 — with GitHub Actions Active
@roeyjos
roeyjos deployed to issue-triage October 2, 2026 20:21 — with GitHub Actions Active
@QuantixBE
QuantixBE deployed to issue-triage October 2, 2026 20:25 — with GitHub Actions Active
@QuantixBE
QuantixBE deployed to issue-triage October 2, 2026 20:25 — with GitHub Actions Active
@QuantixBE
QuantixBE deployed to issue-triage October 2, 2026 20:25 — with GitHub Actions Active
@lcwarnke
lcwarnke deployed to issue-triage October 2, 2026 20:29 — with GitHub Actions Active
@lcwarnke
lcwarnke deployed to issue-triage October 2, 2026 20:29 — with GitHub Actions Active
@lcwarnke
lcwarnke deployed to issue-triage October 2, 2026 20:29 — with GitHub Actions Active
@ryanmish
ryanmish deployed to issue-triage October 2, 2026 20:37 — with GitHub Actions Active
@ryanmish
ryanmish deployed to issue-triage October 2, 2026 20:37 — with GitHub Actions Active
@ryanmish
ryanmish deployed to issue-triage October 2, 2026 20:37 — with GitHub Actions Active
@mbujard
mbujard deployed to issue-triage October 2, 2026 20:47 — with GitHub Actions Active
@mbujard
mbujard deployed to issue-triage October 2, 2026 20:47 — with GitHub Actions Active
@mbujard
mbujard deployed to issue-triage October 2, 2026 20:47 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
issue-triage — 44dd77b7 Deployed Oct 2, 2026 by mbujard via Identify potential duplicates (all issues) #51162
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants