Repository navigation
Handle context length errors consistently across response transports - #60482
Merged
copyberry[bot] merged 1 commit intoNov 10, 2026
Conversation
…60482) ## Why HTTP 400 responses with `context_length_exceeded` need to reach context-window recovery so manual compaction can retry with less history. Streaming context-window failures should end the stream immediately. ## What changed - Map `context_length_exceeded` through the shared terminal provider error parser for HTTP 400 responses and events without an HTTP status. - Return SSE context-window failures immediately. - Preserve retryable handling for WebSocket errors carrying HTTP 503, even when their code is `context_length_exceeded`. ## Testing Add coverage for WebSocket status handling and immediate SSE termination with retry headers. Update the manual compaction test to verify recovery from an HTTP 400 context-window error by dropping one history item and retrying. GitOrigin-RevId: 56d8c831c2fad2ca1318318a3b4258fcc516d689
copyberry
Bot
force-pushed
the
copyberry/codex-internal-to-codex-oss/56d8c831c2fad2ca1318318a3b4258fcc516d689
branch
from
November 10, 2026 00:55
80a05f4 to
1885417
Compare
Contributor
Codex Review Summary: 🔄 RunningThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
copyberry
Bot
deleted the
copyberry/codex-internal-to-codex-oss/56d8c831c2fad2ca1318318a3b4258fcc516d689
branch
November 10, 2026 00:56
esbae-mg
temporarily deployed
to
issue-triage
November 10, 2026 00:57 — with
GitHub Actions
Inactive
esbae-mg
temporarily deployed
to
issue-triage
November 10, 2026 00:57 — with
GitHub Actions
Inactive
esbae-mg
temporarily deployed
to
issue-triage
November 10, 2026 00:57 — with
GitHub Actions
Inactive
Water-Run
temporarily deployed
to
issue-triage
November 10, 2026 01:08 — with
GitHub Actions
Inactive
Water-Run
temporarily deployed
to
issue-triage
November 10, 2026 01:08 — with
GitHub Actions
Inactive
Water-Run
temporarily deployed
to
issue-triage
November 10, 2026 01:08 — with
GitHub Actions
Inactive
Water-Run
temporarily deployed
to
issue-triage
November 10, 2026 01:09 — with
GitHub Actions
Inactive
Saber-1st
temporarily deployed
to
issue-triage
November 10, 2026 01:13 — with
GitHub Actions
Inactive
Saber-1st
temporarily deployed
to
issue-triage
November 10, 2026 01:13 — with
GitHub Actions
Inactive
Saber-1st
temporarily deployed
to
issue-triage
November 10, 2026 01:13 — with
GitHub Actions
Inactive
This branch was previously 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.
Handle context length errors consistently across response transports
Why
HTTP 400 responses with
context_length_exceededneed to reach context-window recovery so manual compaction can retry with less history. Streaming context-window failures should end the stream immediately.What changed
context_length_exceededthrough the shared terminal provider error parser for HTTP 400 responses and events without an HTTP status.context_length_exceeded.Testing
Add coverage for WebSocket status handling and immediate SSE termination with retry headers. Update the manual compaction test to verify recovery from an HTTP 400 context-window error by dropping one history item and retrying.