mirror of
https://github.com/openai/codex.git
synced 2026-11-07 20:30:33 +00:00
Treat model-not-found provider errors as terminal failures (#56445)
## Why Provider errors with code `model_not_found` should end the turn immediately and preserve the provider's message instead of triggering retries. ## What changed - Recognize `model_not_found` in HTTP 400, 403, and 404 responses and in streamed `error` and `response.failed` events. - Preserve the provider message and any available HTTP status, and expose `modelNotFound` through the app-server protocol and generated schemas and SDK types. ## Testing Add coverage for HTTP classification, statusless stream errors, and terminal failures without retries across HTTP, SSE, and WebSocket responses. Verify that `thread/read` preserves the error reported by the live notification. GitOrigin-RevId: 88f824ac03c8c9669915b1e40c67b76c08326fbe
This commit is contained in:
@@ -80,6 +80,7 @@ pub enum CodexErrorInfo {
|
||||
RateLimitExceeded,
|
||||
FlexUnavailable,
|
||||
ServerOverloaded,
|
||||
ModelNotFound,
|
||||
CyberPolicy,
|
||||
MisalignmentPolicyViolation,
|
||||
TooManyDenials,
|
||||
@@ -155,6 +156,7 @@ impl From<CoreCodexErrorInfo> for CodexErrorInfo {
|
||||
CoreCodexErrorInfo::RateLimitExceeded => CodexErrorInfo::RateLimitExceeded,
|
||||
CoreCodexErrorInfo::FlexUnavailable => CodexErrorInfo::FlexUnavailable,
|
||||
CoreCodexErrorInfo::ServerOverloaded => CodexErrorInfo::ServerOverloaded,
|
||||
CoreCodexErrorInfo::ModelNotFound => CodexErrorInfo::ModelNotFound,
|
||||
CoreCodexErrorInfo::CyberPolicy => CodexErrorInfo::CyberPolicy,
|
||||
CoreCodexErrorInfo::BioPolicy => CodexErrorInfo::Other,
|
||||
CoreCodexErrorInfo::MisalignmentPolicyViolation => {
|
||||
|
||||
Reference in New Issue
Block a user