fix: resolve all 5 startup constructor errors + add DB retry
Fixes all errors reported in docker compose logs agent-service: 1. config.py: add ollama_max_concurrent, claude_timeout, claude_max_concurrent fields so LLMRouter(config=settings) can read them without AttributeError. 2. main.py - LLM router: drop manual OllamaBackend/ClaudeBackend construction; call LLMRouter(config=settings, pg_pool=pool) to match class signature. Fixes: OllamaBackend.__init__() unexpected kwarg 'base_url'. 3. main.py - DB: add 5-attempt retry with 2s backoff and redacted DSN logging. Fixes: connection refused race on startup before Postgres accepts connections. 4. main.py - AgentRegistry: call AgentRegistry() with no args (class takes none), then await agent_registry.load_from_odoo(odoo) to populate active agents. Fixes: AgentRegistry.__init__() unexpected kwarg 'odoo'. 5. main.py - PeerBus: pass registry=agent_registry at construction; register specialist agents on agent_registry (not peer_bus, which has no register()). peer_bus.py: make directive_id optional (default None) — bus is a singleton at startup; directive_id is only needed per-request. Fixes: PeerBus.__init__() missing positional args 'registry' and 'directive_id'. 6. main.py - MasterAgent: drop unexpected peer_bus= kwarg from constructor call. Fixes: MasterAgent.__init__() unexpected kwarg 'peer_bus'. 7. mcp_router.py: pass NotificationOptions() instance instead of None. Fixes: AttributeError 'NoneType' has no attribute 'tools_changed' (was applied in running container but not committed; now committed). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -14,10 +14,13 @@ class Settings(BaseSettings):
|
||||
ollama_url: str = 'http://localhost:11434'
|
||||
ollama_model: str = 'llama3'
|
||||
ollama_timeout: int = 120
|
||||
ollama_max_concurrent: int = 2
|
||||
|
||||
# Anthropic / Claude
|
||||
anthropic_api_key: str = ''
|
||||
claude_model: str = 'claude-sonnet-4-6'
|
||||
claude_timeout: int = 120
|
||||
claude_max_concurrent: int = 2
|
||||
|
||||
# Privacy
|
||||
llm_privacy_mode: str = 'local' # local | hybrid | cloud
|
||||
|
||||
Reference in New Issue
Block a user