Skip to main content

aster/agents/error_handling/
mod.rs

1//! Unified Error Handling Module
2//!
3//! This module provides comprehensive error handling for agent execution,
4//! including error recording with context, timeout handling, retry mechanisms,
5//! and context overflow handling.
6//!
7//! # Features
8//!
9//! - **Error Recording**: Record errors with timestamps, context, and stack traces
10//! - **Timeout Handling**: Mark agents as timed out and emit timeout events
11//! - **Retry Mechanism**: Configurable retry behavior for transient failures
12//! - **Overflow Handling**: Automatic compaction and retry on context overflow
13//!
14//! # Requirements Coverage
15//!
16//! - Requirement 15.1: Error recording with context
17//! - Requirement 15.2: Timeout handling with events
18//! - Requirement 15.3: Tool call failure recording
19//! - Requirement 15.4: Configurable retry behavior
20
21mod error_handler;
22mod overflow_handler;
23mod retry_handler;
24mod timeout_handler;
25
26#[cfg(test)]
27mod error_handling_property_tests;
28
29pub use error_handler::{
30    AgentError, AgentErrorKind, ErrorContext, ErrorHandler, ErrorRecord as UnifiedErrorRecord,
31};
32pub use overflow_handler::OverflowHandler;
33pub use retry_handler::{
34    RetryConfig as UnifiedRetryConfig, RetryHandler, RetryResult, RetryStrategy,
35};
36pub use timeout_handler::{TimeoutConfig, TimeoutEvent, TimeoutHandler, TimeoutStatus};