Skip to content

Preserve invalid_prompt as a distinct error classification - #47353

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/5d9a299a013b06158a4dc27a4054f3dbc5fd0f4d
Sep 22, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/5d9a299a013b06158a4dc27a4054f3dbc5fd0f4d

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Preserve invalid_prompt as a distinct error classification

Why

invalid_prompt responses were classified as generic invalid requests, losing the server's specific error classification.

What changed

Add InvalidPrompt variants to the API and core error types and serialize the core protocol classification as invalid_prompt. Recognize the code in HTTP 400 responses, wrapped WebSocket errors, and SSE response.failed events while preserving server messages and keeping the error non-retryable. Map it to other in the app-server v2 protocol.

Testing

Extend coverage for typed error mapping, missing and blank messages, protocol conversion, and guardian retry handling. Exercise HTTP and SSE failures in core integration tests, asserting the error message, serialized classification, and a single request without retry.

## Why

`invalid_prompt` responses were classified as generic invalid requests, losing the server's specific error classification.

## What changed

Add `InvalidPrompt` variants to the API and core error types and serialize the core protocol classification as `invalid_prompt`. Recognize the code in HTTP 400 responses, wrapped WebSocket errors, and SSE `response.failed` events while preserving server messages and keeping the error non-retryable. Map it to `other` in the app-server v2 protocol.

## Testing

Extend coverage for typed error mapping, missing and blank messages, protocol conversion, and guardian retry handling. Exercise HTTP and SSE failures in core integration tests, asserting the error message, serialized classification, and a single request without retry.

GitOrigin-RevId: 5d9a299a013b06158a4dc27a4054f3dbc5fd0f4d
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/5d9a299a013b06158a4dc27a4054f3dbc5fd0f4d branch from c46e86b to 559264d Compare September 22, 2026 20:08
@copyberry
copyberry Bot merged commit 559264d into main Sep 22, 2026
1 check passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/5d9a299a013b06158a4dc27a4054f3dbc5fd0f4d branch September 22, 2026 20:08
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 22, 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