pub enum CodexErr {
Show 35 variants
TurnAborted,
SessionBudgetExceeded,
Stream(String, Option<Duration>),
ContextWindowExceeded,
ThreadNotFound(ThreadId),
AgentLimitReached {
max_threads: usize,
},
SessionConfiguredNotFirstEvent,
Timeout,
RequestTimeout,
Spawn,
Interrupted,
UnexpectedStatus(UnexpectedResponseError),
InvalidRequest(String),
InvalidImageRequest(),
UsageLimitReached(UsageLimitReachedError),
ServerOverloaded,
CyberPolicy {
message: String,
},
ResponseStreamFailed(ResponseStreamFailed),
ConnectionFailed(ConnectionFailedError),
QuotaExceeded,
UsageNotIncluded,
InternalServerError,
RetryLimit(RetryLimitReachedError),
InternalAgentDied,
Sandbox(SandboxErr),
LandlockSandboxExecutableNotProvided,
UnsupportedOperation(String),
RefreshTokenFailed(RefreshTokenFailedError),
Fatal(String),
Io(Error),
Json(Error),
LandlockRuleset(RulesetError),
LandlockPathFd(PathFdError),
TokioJoin(JoinError),
EnvVar(EnvVarError),
}Variants§
TurnAborted
SessionBudgetExceeded
Stream(String, Option<Duration>)
Returned by ResponsesClient when the SSE stream disconnects or errors out after the HTTP
handshake has succeeded but before it finished emitting response.completed.
The Session loop treats this as a transient error and will automatically retry the turn.
Optionally includes the requested delay before retrying the turn.
ContextWindowExceeded
ThreadNotFound(ThreadId)
AgentLimitReached
SessionConfiguredNotFirstEvent
Timeout
Returned by run_command_stream when the spawned child process timed out (10s).
RequestTimeout
Spawn
Returned by run_command_stream when the child could not be spawned (its stdout/stderr pipes
could not be captured). Analogous to the previous CodexError::Spawn variant.
Interrupted
Returned by run_command_stream when the user pressed Ctrl-C (SIGINT). Session uses this to surface a polite FunctionCallOutput back to the model instead of crashing the CLI.
UnexpectedStatus(UnexpectedResponseError)
Unexpected HTTP status code.
InvalidRequest(String)
Invalid request.
InvalidImageRequest()
Invalid image.
UsageLimitReached(UsageLimitReachedError)
ServerOverloaded
CyberPolicy
ResponseStreamFailed(ResponseStreamFailed)
ConnectionFailed(ConnectionFailedError)
QuotaExceeded
UsageNotIncluded
InternalServerError
RetryLimit(RetryLimitReachedError)
Retry limit exceeded.
InternalAgentDied
Agent loop died unexpectedly
Sandbox(SandboxErr)
Sandbox error
LandlockSandboxExecutableNotProvided
UnsupportedOperation(String)
RefreshTokenFailed(RefreshTokenFailedError)
Fatal(String)
Io(Error)
Json(Error)
LandlockRuleset(RulesetError)
LandlockPathFd(PathFdError)
TokioJoin(JoinError)
EnvVar(EnvVarError)
Implementations§
Source§impl CodexErr
impl CodexErr
pub fn is_retryable(&self) -> bool
Sourcepub fn downcast_ref<T: Any>(&self) -> Option<&T>
pub fn downcast_ref<T: Any>(&self) -> Option<&T>
Minimal shim so that existing e.downcast_ref::<CodexErr>() checks continue to compile
after replacing anyhow::Error in the return signature. This mirrors the behavior of
anyhow::Error::downcast_ref but works directly on our concrete enum.
Sourcepub fn to_codex_protocol_error(&self) -> CodexErrorInfo
pub fn to_codex_protocol_error(&self) -> CodexErrorInfo
Translate core error to client-facing protocol error.
pub fn to_error_event(&self, message_prefix: Option<String>) -> ErrorEvent
pub fn http_status_code_value(&self) -> Option<u16>
Trait Implementations§
Source§impl Error for CodexErr
impl Error for CodexErr
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<PathFdError> for CodexErr
impl From<PathFdError> for CodexErr
Source§fn from(source: PathFdError) -> Self
fn from(source: PathFdError) -> Self
Source§impl From<RulesetError> for CodexErr
impl From<RulesetError> for CodexErr
Source§fn from(source: RulesetError) -> Self
fn from(source: RulesetError) -> Self
Source§impl From<SandboxErr> for CodexErr
impl From<SandboxErr> for CodexErr
Source§fn from(source: SandboxErr) -> Self
fn from(source: SandboxErr) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for CodexErr
impl !UnwindSafe for CodexErr
impl Freeze for CodexErr
impl Send for CodexErr
impl Sync for CodexErr
impl Unpin for CodexErr
impl UnsafeUnpin for CodexErr
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<Error> ErrorExt for Error
impl<Error> ErrorExt for Error
Source§fn context<M>(self, context: M) -> OpaqueError
fn context<M>(self, context: M) -> OpaqueError
Source§fn with_context<C, F>(self, context: F) -> OpaqueError
fn with_context<C, F>(self, context: F) -> OpaqueError
Source§fn into_opaque(self) -> OpaqueError
fn into_opaque(self) -> OpaqueError
OpaqueError. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
Source§impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
type Error = <U as RamaTryFrom<T, CrateMarker>>::Error
fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T, CrateMarker>>::Error>
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.