little-car-50043
08/14/2025, 5:28 PMuv run python src/agent.py dev
2025-08-14 13:20:02,364 - DEBUG asyncio - Using selector: EpollSelector
2025-08-14 13:20:02,365 - DEV livekit.agents - Watching /home/dsun/ai-panel-demo/backend/agent-starter-python/src
2025-08-14 13:20:03,173 - DEBUG asyncio - Using selector: EpollSelector
2025-08-14 13:20:03,176 - INFO livekit.agents - starting worker {"version": "1.2.5", "rtc-version": "1.0.12"}
2025-08-14 13:20:03,176 - INFO livekit.agents - preloading plugins {"packages": ["livekit.plugins.openai", "av"]}
2025-08-14 13:20:03,372 - WARNING livekit.agents - failed to connect to livekit, retrying in 0s
Traceback (most recent call last):
File "/home/dsun/ai-panel-demo/backend/agent-starter-python/.venv/lib/python3.12/site-packages/livekit/agents/worker.py", line 648, in _connection_task
ws = await self._http_session.ws_connect(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/dsun/ai-panel-demo/backend/agent-starter-python/.venv/lib/python3.12/site-packages/aiohttp/client.py", line 1084, in _ws_connect
raise WSServerHandshakeError(
aiohttp.client_exceptions.WSServerHandshakeError: 400, message='Invalid response status', url='<ws://localhost:7880/agent>'
Additionally, my locally hosted instance of the agent playground is able to connect to the livekit server with no problem.tall-airline-16756
08/14/2025, 5:28 PMtall-airline-16756
08/14/2025, 5:29 PM400 Invalid response status
usually points to a WebSocket handshake issue.
4. Verify Authentication: Make sure your API keys and tokens are generated properly and included in the WebSocket connection headers.
5. Check Server Configuration: Confirm your self-hosted server is set up right, including firewall rules and that port 7880 is open.
Since your agent playground connects just fine, it might help to compare its setup with your agent’s to spot any differences.
If you want, I’m here to help with any of these steps or if you have questions. Just let me know!
Sources: Agent Testing & Evaluation | livekit/livekit_composite | DeepWiki | agents/src/worker.ts | Diagnosing Connection Errors with Connection Test Utility | Agents Overview | LiveKit Docs