Add comprehensive unit tests for all agent service components

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-20 04:00:45 +00:00
parent 6c22a9a128
commit 20a69313d7
19 changed files with 3734 additions and 66 deletions

View File

@@ -11,14 +11,18 @@ logger = logging.getLogger(__name__)
@dataclass
class AgentDirective:
directive_id: str
agent: str
task: str
params: dict
context: object # DirectiveContext
authorized_actions: list
constraints: dict
agent: str = ''
task: str = ''
params: dict = field(default_factory=dict)
context: object = field(default_factory=dict) # DirectiveContext or dict
authorized_actions: list = field(default_factory=list)
constraints: dict = field(default_factory=dict)
approved: bool = False
approval_item_id: object = None
# Convenience aliases used by agent _plan() methods
intent: str = ''
user_id: str = ''
agent_name: str = ''
@dataclass
@@ -32,10 +36,10 @@ class DirectiveContext:
@dataclass
class AgentReport:
directive_id: str
agent: str
status: str # complete | partial | failed | escalated
summary: str
directive_id: str = ''
status: str = 'complete' # complete | partial | failed | escalated
actions_taken: list = field(default_factory=list)
escalations: list = field(default_factory=list)
peer_calls_made: list = field(default_factory=list)
@@ -48,8 +52,11 @@ class AgentReport:
class SweepReport:
agent: str
findings: list = field(default_factory=list)
actions: list = field(default_factory=list)
actions_taken: list = field(default_factory=list)
recommendations: list = field(default_factory=list)
summary: str = ''
error: object = None
@dataclass