pub enum CodexAskError {
NotFound,
NoSessionId {
types_seen: Vec<String>,
},
TeeOpen {
message: String,
},
Timeout {
timeout_sec: f64,
},
Invocation {
exit_code: i32,
message: String,
},
SigkillEscalated {
partial_exit_code: i32,
},
OsError {
message: String,
},
Interrupted,
}Expand description
Errors from the codex ask path. Each variant maps to a specific Python- compatible exit code.
Variants§
NotFound
codex binary not found (FileNotFoundError) — exit 127.
NoSessionId
JSONL stream ended without a thread.started event — exit 11.
types_seen carries the observed event types for forensics (LD14).
TeeOpen
Cannot open the output.jsonl tee (EACCES/ENOSPC/etc.) — exit 12.
Timeout
Wall-clock timeout — exit 15.
Invocation
codex exited non-zero and no reply was captured — exit = exit_code. Also used for other OSError at spawn time — exit 1.
SigkillEscalated
SIGKILL escalation during reap — always exit 1 regardless of exit_code. A partial reply + SIGKILL is never a success (Python silent-failure-hunter row 4).
OsError
Non-transient OSError at Popen time (not NotFound) — exit 1.
Interrupted
Operator SIGINT (Ctrl-C) forwarded to the codex group — exit 130. Mirrors Python’s KeyboardInterrupt -> CPython exit 130 (ab-e7fdbcb6).
Implementations§
Source§impl CodexAskError
impl CodexAskError
Sourcepub fn exit_code(&self) -> i32
pub fn exit_code(&self) -> i32
Python-compatible exit code for this error.
NotFound maps to 14 (“provider unavailable”) directly here, mirroring
Python’s dispatch.py mapping of CodexInvocationError(127) ->
dispatch_create’s select_provider -> 14. Centralizing the remap
on the error type means both dispatch paths (create and resume) see
the same final exit code (sigma-review type-design HIGH: previously
only dispatch_create carried the inline if exit_code == 127 { 14 }
remap; dispatch_resume would have leaked 127 for the same error).
SigkillEscalated carries the partial exit code so a SIGKILL’d codex
that exited with codex-reported non-zero before the signal preserves
that code (matches codex.py:524 silent-failure-hunter row 4).
Trait Implementations§
Source§impl Debug for CodexAskError
impl Debug for CodexAskError
Source§impl Display for CodexAskError
impl Display for CodexAskError
Source§impl Error for CodexAskError
impl Error for CodexAskError
1.30.0 · 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()