(companion_env) PS D:\Productivity_companion\backe...
# ask-ai
c
(companion_env) PS D:\Productivity_companion\backend> python start_agent_worker_new.py start 2025-09-07 235345,317 - main - INFO - Starting KAORI LiveKit Agent Worker (New Implementation) 2025-09-07 235345,318 - main - INFO - All required environment variables are set 2025-09-07 235345,319 - main - INFO - Agent configuration: 2025-09-07 235345,319 - main - INFO - - Agent name: kaori-voice-agent 2025-09-07 235345,319 - main - INFO - - LiveKit URL: wss://pravidhi-6pg4q80c.livekit.cloud 2025-09-07 235345,320 - main - INFO - - OpenAI model: gpt-4o-mini 2025-09-07 235345,320 - main - INFO - - TTS provider: OpenAI 2025-09-07 235345,320 - main - INFO - - STT provider: Deepgram 2025-09-07 235345,320 - main - INFO - - VAD provider: Silero 2025-09-07 235345,322 - main - INFO - - Turn detection: MultilingualModel 2025-09-07 235345,332 - livekit.agents - INFO - starting worker {"message": "starting worker", "level": "INFO", "name": "livekit.agents", "version": "1.2.8", "rtc-version": "1.0.12", "timestamp": "2025-09-07T182345.332921+00:00"} 2025-09-07 235345,333 - livekit.agents - INFO - starting inference executor {"message": "starting inference executor", "level": "INFO", "name": "livekit.agents", "timestamp": "2025-09-07T182345.333933+00:00"} 2025-09-07 235345,395 - livekit.agents - INFO - initializing process {"message": "initializing process", "level": "INFO", "name": "livekit.agents", "pid": 22040, "inference": true, "timestamp": "2025-09-07T182345.395343+00:00"} 2025-09-07 235350,544 - livekit.agents - DEBUG - initializing inference runner 2025-09-07 235355,406 - livekit.agents - INFO - killing process {"message": "killing process", "level": "INFO", "name": "livekit.agents", "pid": 22040, "inference": true, "timestamp": "2025-09-07T182355.406180+00:00"} 2025-09-07 235355,407 - livekit.agents - ERROR - worker failed Traceback (most recent call last): File "D:\conda\envs\companion_env\Lib\asyncio\tasks.py", line 520, in wait_for return await fut ^^^^^^^^^ File "D:\conda\envs\companion_env\Lib\site-packages\livekit\agents\ipc\channel.py", line 47, in arecv_message return _read_message(await dplx.recv_bytes(), messages) ^^^^^^^^^^^^^^^^^^^^^^^ File "D:\conda\envs\companion_env\Lib\site-packages\livekit\agents\utils\aio\duplex_unix.py", line 35, in recv_bytes len_bytes = await self._reader.readexactly(4) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\conda\envs\companion_env\Lib\asyncio\streams.py", line 752, in readexactly await self._wait_for_data('readexactly') File "D:\conda\envs\companion_env\Lib\asyncio\streams.py", line 545, in _wait_for_data await self._waiter asyncio.exceptions.CancelledError The above exception was the direct cause of the following exception: Traceback (most recent call last): File "D:\conda\envs\companion_env\Lib\site-packages\livekit\agents\cli\_run.py", line 79, in _worker_run await worker.run() File "D:\conda\envs\companion_env\Lib\site-packages\livekit\agents\worker.py", line 403, in run await self._inference_executor.initialize() File "D:\conda\envs\companion_env\Lib\site-packages\livekit\agents\ipc\supervised_proc.py", line 169, in initialize init_res = await asyncio.wait_for( ^^^^^^^^^^^^^^^^^^^^^^^ File "D:\conda\envs\companion_env\Lib\asyncio\tasks.py", line 519, in wait_for async with timeouts.timeout(timeout): ^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\conda\envs\companion_env\Lib\asyncio\timeouts.py", line 115, in aexit raise TimeoutError from exc_val TimeoutError {"message": "worker failed", "level": "ERROR", "name": "livekit.agents", "exc_info": "Traceback (most recent call last):\n File \"D:\\conda\\envs\\companion_env\\Lib\\asyncio\\tasks.py\", line 520, in wait_for\n return await fut\n ^^^^^^^^^\n File \"D:\\conda\\envs\\companion_env\\Lib\\site-packages\\livekit\\agents\\ipc\\channel.py\", line 47, in arecv_message\n return _read_message(await dplx.recv_bytes(), messages)\n ^^^^^^^^^^^^^^^^^^^^^^^\n File \"D:\\conda\\envs\\companion_env\\Lib\\site-packages\\livekit\\agents\\utils\\aio\\duplex_unix.py\", line 35, in recv_bytes\n len_bytes = await self._reader.readexactly(4)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"D:\\conda\\envs\\companion_env\\Lib\\asyncio\\streams.py\", line 752, in readexactly\n await self._wait_for_data('readexactly')\n File \"D:\\conda\\envs\\companion_env\\Lib\\asyncio\\streams.py\", line 545, in _wait_for_data\n await self._waiter\nasyncio.exceptions.CancelledError\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"D:\\conda\\envs\\companion_env\\Lib\\site-packages\\livekit\\agents\\cli\\_run.py\", line 79, in _worker_run\n await worker.run()\n File \"D:\\conda\\envs\\companion_env\\Lib\\site-packages\\livekit\\agents\\worker.py\", line 403, in run\n await self._inference_executor.initialize()\n File \"D:\\conda\\envs\\companion_env\\Lib\\site-packages\\livekit\\agents\\ipc\\supervised_proc.py\", line 169, in initialize\n init_res = await asyncio.wait_for(\n ^^^^^^^^^^^^^^^^^^^^^^^\n File \"D:\\conda\\envs\\companion_env\\Lib\\asyncio\\tasks.py\", line 519, in wait_for\n async with timeouts.timeout(timeout):\n ^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"D:\\conda\\envs\\companion_env\\Lib\\asyncio\\timeouts.py\", line 115, in __aexit__\n raise TimeoutError from exc_val\nTimeoutError", "timestamp": "2025-09-07T182355.407182+00:00"} 2025-09-07 235355,481 - livekit.agents - INFO - draining worker {"message": "draining worker", "level": "INFO", "name": "livekit.agents", "id": "unregistered", "timeout": 1800, "timestamp": "2025-09-07T182355.481461+00:00"} 2025-09-07 235355,486 - main - INFO - KAORI agent worker shutdown complete {"message": "KAORI agent worker shutdown complete", "level": "INFO", "name": "__main__", "timestamp": "2025-09-07T182355.486023+00:00"} (companion_env) PS D:\Productivity_companion\backend>
t
Thanks for reaching out, raj. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! The
TimeoutError
you're seeing during the inference executor initialization usually happens when the process takes longer than the default 10 seconds. No worries—here are some common reasons and easy fixes: • CPU Throttling: If you're on AWS t3/t4 burstable instances, your CPU might be getting throttled because the credits ran out, which can slow things down. Switching to a non-burstable instance like
m5
,
c5
, or
c6i
usually helps keep things running smoothly. If you need to stick with burstable instances, keep an eye on the
CPUCreditBalance
metric and think about turning on
t3.unlimited
. • Missing Model Files: Double-check that all the models you need are already downloaded. For example, if you're using the
turn-detector
plugin, run the
download-files
command in your agent script to grab everything necessary. • Pre-initialization Tasks: Take a look at your
prewarm_fnc
function—if it’s doing something that takes a while, try to speed it up. Or, you can increase the
initialize_process_timeout
in
WorkerOptions
to give it more time (like 30 or 60 seconds). If you want, I’m here to help you walk through any of these steps—just let me know! Sources: livekit-agents/livekit/agents/ipc/inference_proc_executor.py | Troubleshooting Latency and Timeout Errors with Turn Detection on AWS