LiveKit agent fails to connect to self-hosted server - upgrade required

This question originally came up in our Slack community and the thread has been consolidated here for long-term reference.

Can LiveKit agents connect to a self-hosted livekit-server, or only to LiveKit Cloud?

I tried to connect my agent (for AI room summaries) but it fails with this error:

WARNING livekit.agents - failed to connect to livekit, retrying in 0s: 
Received message 257:None is not WSMsgType.BINARY

My self-hosted LiveKit server is running version 1.5.2.

Yes, LiveKit agents can connect to self-hosted servers.

The solution: Upgrade to the latest LiveKit server version (1.9.4 or later).

The error you’re seeing is due to protocol incompatibility between the older server version and the current agents SDK. After upgrading the server, agents should be able to connect to rooms successfully.