use thiserror::Error;
#[derive(Debug, Error, Clone)]
pub enum AgentError {
#[error("Max iterations ({0}) reached without final answer")]
MaxIterationsExceeded(u32),
#[error("Tool '{name}' not found in registry")]
ToolNotFound { name: String },
#[error("Tool '{name}' execution failed: {reason}")]
ToolFailed { name: String, reason: String },
#[error("Parse error in ReAct step: {0}")]
ParseError(String),
#[error("Timeout: agent exceeded {timeout_ms}ms budget")]
Timeout { timeout_ms: u64 },
#[error("History overflow: {size} tokens exceeds context limit {limit}")]
HistoryOverflow { size: usize, limit: usize },
#[error("Serialization error: {0}")]
Serialization(String),
#[error("Invalid tool signature: {0}")]
InvalidToolSignature(String),
}