pub enum CoreError {
UnknownTool(String),
ToolInputValidation(String),
ToolOutput(String),
ModelProvider(String),
ModelResponse(String),
Transport(String),
Cancelled(String),
TurnTimeout {
ms: u64,
},
}Expand description
Errors raised by the core agent/model layer.
Variants§
UnknownTool(String)
A tool call referenced an unknown tool.
ToolInputValidation(String)
Tool input failed JSON-schema validation.
ToolOutput(String)
Tool output failed to serialize or validate.
ModelProvider(String)
The model provider rejected the request.
ModelResponse(String)
The model response could not be parsed.
Transport(String)
An I/O or transport error talking to a provider.
Cancelled(String)
A caller cancelled the operation (e.g. SIGINT, token triggered).
Distinct from CoreError::TurnTimeout: a caller-initiated abort,
not a deadline elapsing. Keeping the two separate lets the CLI map a
turn-budget timeout to exit code 124 without string-matching the
message (the headless runner contract distinguishes them).
TurnTimeout
A per-turn deadline elapsed (the agent loop’s turn_timeout_ms).
Mapped to exit code 124 by the CLI headless runner (matching the
timeout(1) convention used by the bash tool). This is a deadline
event, not caller-initiated cancellation — see CoreError::Cancelled.
Trait Implementations§
Source§impl Error for CoreError
impl Error for CoreError
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()