diff --git a/ai-hub/app/core/orchestration/agent_loop.py b/ai-hub/app/core/orchestration/agent_loop.py index 663ab03..8b7a9c0 100644 --- a/ai-hub/app/core/orchestration/agent_loop.py +++ b/ai-hub/app/core/orchestration/agent_loop.py @@ -65,6 +65,7 @@ return await self._handle_fatal_error(e) finally: heartbeat_task.cancel() + self.db.close() async def _safe_commit(self) -> bool: """Commits current DB changes with robust error handling for concurrent deletions.""" @@ -144,7 +145,8 @@ await self._safe_commit() # Parallel rubric generation task - return asyncio.create_task(self._rubric_generator_bg(prompt, provider, workspace_id)) + mesh_node_id = str(self.instance.mesh_node_id) + return asyncio.create_task(self._rubric_generator_bg(prompt, provider, workspace_id, mesh_node_id)) def _resolve_eval_provider(self): """Determines the LLM provider configuration for the Auditor using PreferenceService.""" @@ -160,12 +162,12 @@ ) return provider - async def _rubric_generator_bg(self, prompt: str, provider, workspace_id) -> Optional[str]: + async def _rubric_generator_bg(self, prompt: str, provider, workspace_id, mesh_node_id: str) -> Optional[str]: """Background helper for non-blocking rubric generation.""" bg_db = SessionLocal() from app.core.orchestration.harness_evaluator import HarnessEvaluator try: - bg_evaluator = HarnessEvaluator(bg_db, self.agent_id, self.instance.mesh_node_id, workspace_id, provider, self.services) + bg_evaluator = HarnessEvaluator(bg_db, self.agent_id, mesh_node_id, workspace_id, provider, self.services) await bg_evaluator.initialize_cortex() return await bg_evaluator.generate_rubric(prompt) except Exception as e: diff --git a/ai-hub/integration_tests/conftest.py b/ai-hub/integration_tests/conftest.py index 8a25084..ed00c87 100644 --- a/ai-hub/integration_tests/conftest.py +++ b/ai-hub/integration_tests/conftest.py @@ -40,7 +40,7 @@ print(f"\n[conftest] Starting Mesh Integration Setup...") print(f"[conftest] BASE_URL={base_url} ADMIN={admin_email}") - client = httpx.Client(timeout=90.0) + client = httpx.Client(timeout=300.0) # 1. Login print(f"[conftest] Logging in as {admin_email} (password: {admin_password}) at {base_url} ...")