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.
This commit is contained in:
@@ -554,7 +554,10 @@ async def handle_job(ctx: JobContext) -> None:
|
|||||||
logger.info("user state -> %s", ev.new_state)
|
logger.info("user state -> %s", ev.new_state)
|
||||||
|
|
||||||
# ── Background task events → room data channel ─────────────────────────
|
# ── Background task events → room data channel ─────────────────────────
|
||||||
|
try:
|
||||||
from agent.task_registry import registry as task_registry
|
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:
|
async def _publish_task_event(task_id: str, event: dict) -> None:
|
||||||
payload = json.dumps({"type": "task_event", "task_id": task_id, **event})
|
payload = json.dumps({"type": "task_event", "task_id": task_id, **event})
|
||||||
|
|||||||
Reference in New Issue
Block a user