Repository navigation
Honor Retry-After headers in failed Responses events - #50418
Merged
copyberry[bot] merged 1 commit intoOct 2, 2026
Merged
copyberry[bot] merged 1 commit into
copyberry[bot] merged 1 commit into
Conversation
## 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
Bot
force-pushed
the
copyberry/codex-internal-to-codex-oss/46433c2e9e6d5e804211ef96950fadd70e322b49
branch
from
October 2, 2026 20:19
f11d9e2 to
44dd77b
Compare
copyberry
Bot
deleted the
copyberry/codex-internal-to-codex-oss/46433c2e9e6d5e804211ef96950fadd70e322b49
branch
October 2, 2026 20:19
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Honor Retry-After headers in failed Responses events
Why
Streamed
response.failedevents can carry retry advice inresponse.error.headers. Ignoring it loses server-provided delays or uses a conflicting delay from a rate-limit message.What changed
Retry-Afterheaders using the existing HTTP header validation and retry parser, and preserve them for rate-limit, overload, and generic retryable failures.Testing
Add regression coverage for header precedence, validation, and terminal errors, plus retry-loop coverage for SSE sampling, remote compaction, and WebSocket failures.