pub enum LoopError {
Stream(StreamError),
Aborted,
ToolFatal {
tool: String,
reason: String,
},
InvalidContinuation(String),
EmptyOutcomeBudgetExhausted {
budget: usize,
observed: usize,
},
}Expand description
Why the loop terminated abnormally.
A successful run returns Ok(messages) with no error. The loop’s
natural stop condition (no more tool calls + no follow-up) does not
produce an error.
Variants§
Stream(StreamError)
Stream transport raised an unrecoverable error. The provider
implementation decides what’s recoverable; everything that bubbles
up through StreamFn::stream ends the run.
Aborted
Caller cancelled via the abort signal.
ToolFatal
A tool encountered an unrecoverable failure and requested that the loop stop immediately rather than append a recoverable context event.
InvalidContinuation(String)
Cannot continue without a starting message: run_continue was
called on an empty context, or the trailing message is assistant
(which the model would not respond to).
EmptyOutcomeBudgetExhausted
The model repeatedly stopped without any tool call after the configured no-tool recovery budget had already been spent.
Trait Implementations§
Source§impl Error for LoopError
impl Error for LoopError
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()