Post-coordination-removal sweep: the coordination wire protocol (AgentRequest, AgentResponse, DelegationIntent, CoordinationResult, DelegationReason, TaskComplexity, ToolCallRecord, AgentTimeoutError, AgentUnavailableError, DelegationError) had zero importers left in src/ - only its own test module. AgentError stays (raised by run_librarian, mapped to user-safe failures by delegation.py). Also drops the stale coordination.py line from the README tree. Import-cycle sanity: python -c 'import src.main' passes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QbFZyDvYksazX6nYQYZ67L
18 lines
543 B
Python
18 lines
543 B
Python
"""
|
|
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}")
|