pub enum AgentLoopError {
Show 15 variants
Llm(String),
RequestTooLarge(String),
ModelNotAvailable(String),
ToolExecution(String),
MessageStore(String),
EventEmission(String),
Configuration(String),
MaxIterationsReached(usize),
Cancelled,
NoMessages,
AgentNotFound(AgentId),
HarnessNotFound(HarnessId),
SessionNotFound(SessionId),
Internal(Error),
DriverNotRegistered(String),
}Expand description
Errors that can occur during agent loop execution
Variants§
Llm(String)
LLM provider error
RequestTooLarge(String)
Request too large error (context length exceeded, token limits, etc.) Contains the original error message for logging
ModelNotAvailable(String)
Model not available (404, model not found, access denied for model) Contains the model_id string that was requested
ToolExecution(String)
Tool execution error
MessageStore(String)
Message store error
EventEmission(String)
Event emission error
Configuration(String)
Configuration error
MaxIterationsReached(usize)
Loop terminated due to max iterations
Cancelled
Loop was cancelled
NoMessages
No messages to process
AgentNotFound(AgentId)
Agent not found
HarnessNotFound(HarnessId)
Harness not found
SessionNotFound(SessionId)
Session not found
Internal(Error)
Internal error
DriverNotRegistered(String)
Driver not registered for provider type
Implementations§
Source§impl AgentLoopError
impl AgentLoopError
Sourcepub fn agent_not_found(agent_id: AgentId) -> Self
pub fn agent_not_found(agent_id: AgentId) -> Self
Create an agent not found error
Sourcepub fn harness_not_found(harness_id: HarnessId) -> Self
pub fn harness_not_found(harness_id: HarnessId) -> Self
Create a harness not found error
Sourcepub fn session_not_found(session_id: SessionId) -> Self
pub fn session_not_found(session_id: SessionId) -> Self
Create a session not found error
Sourcepub fn driver_not_registered(provider_type: impl Into<String>) -> Self
pub fn driver_not_registered(provider_type: impl Into<String>) -> Self
Create a driver not registered error
Sourcepub fn request_too_large(msg: impl Into<String>) -> Self
pub fn request_too_large(msg: impl Into<String>) -> Self
Create a request too large error
Sourcepub fn model_not_available(model_id: impl Into<String>) -> Self
pub fn model_not_available(model_id: impl Into<String>) -> Self
Create a model not available error
Sourcepub fn is_request_too_large(&self) -> bool
pub fn is_request_too_large(&self) -> bool
Check if this is a request-too-large error
Sourcepub fn is_model_not_available(&self) -> bool
pub fn is_model_not_available(&self) -> bool
Check if this is a model-not-available error
Sourcepub fn model_not_available_id(&self) -> Option<&str>
pub fn model_not_available_id(&self) -> Option<&str>
Get the model ID if this is a model-not-available error
Sourcepub fn is_rate_limited(&self) -> bool
pub fn is_rate_limited(&self) -> bool
Check if this is a rate-limit error (HTTP 429 or rate-limit keywords)
Sourcepub fn is_auth_error(&self) -> bool
pub fn is_auth_error(&self) -> bool
Check if this is an authentication/authorization error (HTTP 401/403)
Sourcepub fn is_server_error(&self) -> bool
pub fn is_server_error(&self) -> bool
Check if this is a server error (HTTP 5xx or transient provider issue)
Sourcepub fn is_non_retryable(&self) -> bool
pub fn is_non_retryable(&self) -> bool
Check if this error is deterministic and should never be retried.
Non-retryable errors reference data that is permanently gone (e.g. a deleted message, a missing agent). Retrying will never succeed and only burns attempts while keeping the workflow stuck.
Note: the durable worker currently uses string-matching via
is_non_retryable_task_error because task errors arrive as strings.
This method provides the typed equivalent for callers that have access
to a structured AgentLoopError.
Sourcepub fn user_facing_message(&self) -> String
pub fn user_facing_message(&self) -> String
Get user-facing error message based on error classification
Sourcepub fn user_facing_error(
&self,
context: UserFacingErrorContext,
) -> UserFacingError
pub fn user_facing_error( &self, context: UserFacingErrorContext, ) -> UserFacingError
Get structured user-facing error metadata based on error classification.
Trait Implementations§
Source§impl Debug for AgentLoopError
impl Debug for AgentLoopError
Source§impl Display for AgentLoopError
impl Display for AgentLoopError
Source§impl Error for AgentLoopError
impl Error for AgentLoopError
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()
Auto Trait Implementations§
impl Freeze for AgentLoopError
impl RefUnwindSafe for AgentLoopError
impl Send for AgentLoopError
impl Sync for AgentLoopError
impl Unpin for AgentLoopError
impl UnsafeUnpin for AgentLoopError
impl UnwindSafe for AgentLoopError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request