From dd33837055104fd67aff9cbb8ef077390b68068f Mon Sep 17 00:00:00 2001 From: Shane Date: Sat, 22 Aug 2026 18:41:11 -0400 Subject: [PATCH] fix: import task_registry without 'agent.' package prefix in container In the container, agent.py is at /opt/voice-agent/agent.py (flat, not a package). The 'from agent.task_registry import ...' raised ModuleNotFoundError which killed the job before session.start(), causing 'assistant not ready retry' in the browser. Added try/except ImportError fallback to bare import. --- agent/agent.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/agent/agent.py b/agent/agent.py index 59cdfed..7c3a3a4 100644 --- a/agent/agent.py +++ b/agent/agent.py @@ -554,7 +554,10 @@ async def handle_job(ctx: JobContext) -> None: logger.info("user state -> %s", ev.new_state) # ── Background task events → room data channel ───────────────────────── - from agent.task_registry import registry as task_registry + try: + from agent.task_registry import registry as task_registry + except ImportError: + from task_registry import registry as task_registry async def _publish_task_event(task_id: str, event: dict) -> None: payload = json.dumps({"type": "task_event", "task_id": task_id, **event})