diff --git a/src/agents/delegation.py b/src/agents/delegation.py index b04c356..9b99644 100644 --- a/src/agents/delegation.py +++ b/src/agents/delegation.py @@ -218,7 +218,7 @@ class DelegationTask: result: str | None = None task_id: str = "" - def __post_init__(self): + def __post_init__(self) -> None: """Generate task ID if not provided.""" if not self.task_id: import uuid diff --git a/src/agents/steward/agent.py b/src/agents/steward/agent.py index 75e2b7d..a176180 100644 --- a/src/agents/steward/agent.py +++ b/src/agents/steward/agent.py @@ -109,7 +109,7 @@ class StewardAgent: (preferred) and Ollama (fallback) backends via direct API calls. """ - def __init__(self): + def __init__(self) -> None: """Initialize Steward with backend selection based on availability.""" # Ollama config (primary) self.ollama_host = str(config.OLLAMA_HOST).rstrip("/") diff --git a/src/agents/tatlock.py b/src/agents/tatlock.py index bc5ed4c..821d2fa 100644 --- a/src/agents/tatlock.py +++ b/src/agents/tatlock.py @@ -36,7 +36,7 @@ class ToolCallTracker: calls: list[str] = field(default_factory=list) - def log_call(self, message: str): + def log_call(self, message: str) -> None: """Log a tool call.""" self.calls.append(message) @@ -155,14 +155,14 @@ class TatlockAgent(AgentInterface): currently in Phase 1 (basic LLM integration without expert agents). """ - def __init__(self): + def __init__(self) -> None: """Initialize Tatlock (lazy agent creation).""" # Deps are a ToolCallTracker: every registered tool takes # RunContext[ToolCallTracker], and run() is called with one. Saying so # is what lets the tool registrations below type-check at all. self._agent: Agent[ToolCallTracker, str] | None = None # Lazy initialization - def _ensure_agent(self): + def _ensure_agent(self) -> None: """Ensure the PydanticAI agent is initialized (lazy initialization).""" if self._agent is not None: return diff --git a/src/core/context.py b/src/core/context.py index eebf01f..82ad918 100644 --- a/src/core/context.py +++ b/src/core/context.py @@ -18,6 +18,7 @@ Usage: """ from contextvars import ContextVar +from types import TracebackType def get_default_user() -> str: @@ -142,7 +143,12 @@ class RequestContext: self._conv_token = current_conversation.set(self.conversation_id) return self - async def __aexit__(self, exc_type, exc_val, exc_tb) -> None: + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: """Reset context variables on exit.""" if self._user_token is not None: current_user.reset(self._user_token) @@ -155,7 +161,12 @@ class RequestContext: self._conv_token = current_conversation.set(self.conversation_id) return self - def __exit__(self, exc_type, exc_val, exc_tb) -> None: + def __exit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: """Sync context manager exit.""" if self._user_token is not None: current_user.reset(self._user_token) diff --git a/src/core/embeddings.py b/src/core/embeddings.py index 8f7c705..481ef6a 100644 --- a/src/core/embeddings.py +++ b/src/core/embeddings.py @@ -9,6 +9,8 @@ Provides async embedding operations via Ollama API: Adapted from library-desk patterns. """ +from types import TracebackType + import httpx from .config import config @@ -72,7 +74,12 @@ class OllamaEmbeddingClient: await self._get_client() return self - async def __aexit__(self, exc_type, exc_val, exc_tb) -> None: + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc_val: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: """Async context manager exit.""" await self.close() diff --git a/src/core/household_registry.py b/src/core/household_registry.py index a36bc22..dd1abda 100644 --- a/src/core/household_registry.py +++ b/src/core/household_registry.py @@ -57,7 +57,7 @@ class HouseholdRegistry: 3. Agent delegation (Phase 4) """ - def __init__(self): + def __init__(self) -> None: """Initialize empty registry.""" self._members: dict[str, HouseholdMember] = {} logger.info("household_registry_initialized") diff --git a/src/core/memory_service.py b/src/core/memory_service.py index 8b95e8f..22e6f87 100644 --- a/src/core/memory_service.py +++ b/src/core/memory_service.py @@ -74,7 +74,7 @@ class MemoryService: - Semantic recall: "What did I mention about X?" → Use Memory Agent """ - def __init__(self): + def __init__(self) -> None: """Initialize memory service with lazy client loading.""" self._qdrant = None self._embedding = None diff --git a/src/core/startup.py b/src/core/startup.py index ac2aa61..6fc4921 100644 --- a/src/core/startup.py +++ b/src/core/startup.py @@ -47,7 +47,7 @@ def log_tenant_guard() -> None: ) -def register_household_members(): +def register_household_members() -> None: """ Register all household members with the registry. @@ -113,7 +113,7 @@ def register_household_members(): ) -async def initialize_application(): +async def initialize_application() -> None: """ Initialize the application. diff --git a/src/core/tool_tracking.py b/src/core/tool_tracking.py index 052d726..1e2d9d3 100644 --- a/src/core/tool_tracking.py +++ b/src/core/tool_tracking.py @@ -46,11 +46,11 @@ class ToolCallTracker: return tool_name.replace("delegate_to_", "") return tool_name - def log_call(self, message: str): + def log_call(self, message: str) -> None: """Log a tool call message (for UI display).""" logger.debug("tool_call_message", message=message) - async def track_call(self, tool_name: str, duration: float): + async def track_call(self, tool_name: str, duration: float) -> None: """ Record a tool call with timing. @@ -82,7 +82,7 @@ class ToolCallTracker: was_recommended=was_recommended, ) - async def finalize(self): + async def finalize(self) -> None: """ Finalize tracking and log unused recommended tools.