Skip to content

Treat incomplete responses as terminal errors - #53451

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/6e107d441b9bf03fa47ea47b88eeb94b71a9f729
Oct 12, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/6e107d441b9bf03fa47ea47b88eeb94b71a9f729

Conversation

@copyberry

@copyberry copyberry Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Treat incomplete responses as terminal errors

Why

Incomplete responses such as max_output_tokens were classified as stream errors, allowing retries and compaction model fallback after the response had hit its output limit.

What changed

Introduce ResponseIncomplete errors that preserve the server-provided reason and stop stream processing immediately. Make these errors non-retryable and stop compaction without falling back to the selected model. Record incomplete responses separately in sampler failure metrics.

Testing

Add regression tests that verify incomplete responses surface a terminal error without retries over SSE and WebSocket, and that compaction stops without retrying or switching models for both local and remote compaction.

## Why

Incomplete responses such as `max_output_tokens` were classified as stream errors, allowing retries and compaction model fallback after the response had hit its output limit.

## What changed

Introduce `ResponseIncomplete` errors that preserve the server-provided reason and stop stream processing immediately. Make these errors non-retryable and stop compaction without falling back to the selected model. Record incomplete responses separately in sampler failure metrics.

## Testing

Add regression tests that verify incomplete responses surface a terminal error without retries over SSE and WebSocket, and that compaction stops without retrying or switching models for both local and remote compaction.

GitOrigin-RevId: 6e107d441b9bf03fa47ea47b88eeb94b71a9f729
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/6e107d441b9bf03fa47ea47b88eeb94b71a9f729 branch from bc1ee5c to bc9cad3 Compare October 12, 2026 18:54
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
πŸ“ Code Review πŸ”„ Running since 2026-10-12T18:54:01.205316Z bc1ee5c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with πŸ‘€ while any review is running, comments if it has suggestions, and reacts with πŸ‘ once all reviews finish with no findings.

@copyberry
copyberry Bot merged commit bc9cad3 into main Oct 12, 2026
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/6e107d441b9bf03fa47ea47b88eeb94b71a9f729 branch October 12, 2026 18:54
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 12, 2026
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.

1 participant