Skip to content

Treat invalid access program stream errors as terminal - #60481

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/5431a2babec64eae5cdf6c138b98e91e84778e79
Nov 10, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/5431a2babec64eae5cdf6c138b98e91e84778e79

Conversation

@copyberry

@copyberry copyberry Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Treat invalid access program stream errors as terminal

Why

An invalid_access_program or unsupported_access_program streaming error should end the stream immediately, even if a later response.completed event arrives or the error includes a retry header.

What changed

Map both error codes to ApiError::InvalidRequest and stop processing the response stream on invalid requests. Preserve a nonblank provider message, falling back to an explanation that the requested access program cannot be used with the model.

Testing

Extend the terminal-error test to cover both codes in error and response.failed events, verifying that retry headers are ignored and the stream ends before a later completion event.

## Why

An `invalid_access_program` or `unsupported_access_program` streaming error should end the stream immediately, even if a later `response.completed` event arrives or the error includes a retry header.

## What changed

Map both error codes to `ApiError::InvalidRequest` and stop processing the response stream on invalid requests. Preserve a nonblank provider message, falling back to an explanation that the requested access program cannot be used with the model.

## Testing

Extend the terminal-error test to cover both codes in `error` and `response.failed` events, verifying that retry headers are ignored and the stream ends before a later completion event.

GitOrigin-RevId: 5431a2babec64eae5cdf6c138b98e91e84778e79
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/5431a2babec64eae5cdf6c138b98e91e84778e79 branch from 4e23822 to d9446b4 Compare November 10, 2026 00:55
@copyberry
copyberry Bot merged commit d9446b4 into main Nov 10, 2026
8 of 23 checks passed
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor
Codex Review Summary: 🔄 Running

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

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-11-10T00:55:27.110985Z 4e23822 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 deleted the copyberry/codex-internal-to-codex-oss/5431a2babec64eae5cdf6c138b98e91e84778e79 branch November 10, 2026 00:55
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 10, 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