pub enum AgentError {
ProviderError(ProviderError),
Cancelled,
UnexpectedEvent(String),
ToolError(String),
TurnBudgetExceeded,
ContextBudgetExceeded {
estimated: u32,
limit: u32,
},
DoomLoopDetected(String),
HookDenied(String),
}Expand description
Errors that can occur during agent execution.
Variants§
ProviderError(ProviderError)
An error from the underlying LLM provider.
Cancelled
The turn was cancelled via [CancellationToken].
UnexpectedEvent(String)
An unexpected event sequence was received.
ToolError(String)
A tool-related error occurred (lookup failure, execution panic, etc.).
TurnBudgetExceeded
The turn exceeds the maximum allowed tool call budget.
ContextBudgetExceeded
The next provider request would exceed the configured model context.
Fields
DoomLoopDetected(String)
A potential doom loop was detected — the same tool was called with identical arguments multiple times in a single turn.
HookDenied(String)
A hook denied the current operation.
Trait Implementations§
Source§impl Debug for AgentError
impl Debug for AgentError
Source§impl Display for AgentError
impl Display for AgentError
Source§impl Error for AgentError
impl Error for AgentError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<ProviderError> for AgentError
impl From<ProviderError> for AgentError
Source§fn from(source: ProviderError) -> Self
fn from(source: ProviderError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for AgentError
impl RefUnwindSafe for AgentError
impl Send for AgentError
impl Sync for AgentError
impl Unpin for AgentError
impl UnsafeUnpin for AgentError
impl UnwindSafe for AgentError
Blanket Implementations§
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
Mutably borrows from an owned value. Read more