""" Agent error protocol. Structured exceptions raised by expert agents (e.g. The Librarian) so callers - the delegation wrappers in src/agents/delegation.py - can report success=False and map failures to curated user-safe messages while exception detail stays in the logs. """ class AgentError(Exception): """Base exception for agent errors.""" def __init__(self, message: str, agent_name: str = "unknown"): self.message = message self.agent_name = agent_name super().__init__(f"[{agent_name}] {message}")