Hi. Did anything change recently for automatic dispatches (no agent_name)? All my calls relying on this stopped working entirely recently, without making any change to the code.
It just fails silently on the livekit end, no errors whatsoever. Session ends after 1 second and no agent joins.
It seems that automatic dispatches really do not work anymore… Setting an agent_name in the worker and changing the telephony dispatch rules accordingly seems to make things work again.
Why did this just stop working, though?
Do you have a room ID where agent did not get dispatched?
I just tried this and it is working for me.
What version of agents and plugins are you using?
Thanks for the swift reply, @CWilson !
e.g. these were failing: RM_B3Mu9HXo7uZY, RM_TsZRHV6xYDPA
then after using an explicit agent_name, it started working again, e.g.: RM_f3ZpuyfYXEtj
Now that part works fine, except outbound calls - they stopped to work at all for me.
I am constantly getting “sip request timed out” at the moment (using a twilio sip trunk), which I had never seen before (e.g. SCL_6wyBcmRJdWkr).
Core LiveKit dependencies:
“livekit~=1.0”,
“livekit-agents~=1.3”,
“livekit-plugins-anthropic~=1.3”,
“livekit-plugins-cartesia~=1.3”,
“livekit-plugins-deepgram~=1.3”,
“livekit-plugins-elevenlabs~=1.3”,
“livekit-plugins-groq~=1.3”,
“livekit-plugins-openai~=1.3”,
“livekit-plugins-silero~=1.3”,
“livekit-plugins-turn-detector~=1.3”,
“livekit-plugins-noise-cancellation~=0.2”,
I looked at RM_B3Mu9HXo7uZY and saw the job was assigned to a worker. What do you see in your agent logs?
For SCL_6wyBcmRJdWkr I see we tried to assign it to two different workers:
- AW_t3LLEUgszdG5
- AW_np5zUazkwYs5
I need to see your agent logs to understand why it is not connecting.
I am also curious why you are using such an old version of agents 1.3
Resources:
UPDATE:
I found the problem. And, well, this is quite embarrassing ![]()
I had spun up a Docker container with a LK worker to test something quick, which I forgot to turn off. So LK was trying to assign tasks to this worker all the time.
Sorry for that ![]()
UPDATE 2:
To elaborate on my previous reasoning regarding dependencies, I just upgraded to version 1.5, and unfortunately, there are breaking changes (from 1.4) again.
Since livekit-agents 1.4, it seems that AgentActivity._start_session() inserts an
AgentConfigUpdate item into the agent’s chat_ctx before on_enter runs (add `AgentConfigUpdate` & initial judges by theomonnom · Pull Request #4547 · livekit/agents · GitHub - to enable Conversation history now records agent configuration updates (instructions/tools) and initial configs. as Theo describes in that PR, I assume)
This AgentConfigUpdate has no .content attribute, so if the code was relying on e.g. chat_ctx.items[-1].content to check something - as I was doing -, this will not be there the way it used to (and would actually raise an AttributeError if accessed like that).
So 1.3 had breaking changes and 1.4 had breaking changes, although both were minor releases.
For those failed rooms I have no logs (like, zero), since the worker was not being “hit” at all. No activity whatsoever. (Which makes me wonder: was it trying to assign to non existing workers, perhaps?)
After…
Setting an agent_name in the worker and changing the telephony dispatch rules accordingly seems to make things work again.
… the worker started showing activity again when calls were initiated and everything started working as usual.
(As I was saying, I wasn’t using named agents before, since I’ve always just had a single agent with one entrypoint that acted as a switch for multiple sub-entrypoints - which worked better for my use-case than having multiple agents - and it just worked fine. Maybe this is some sort of side effect of this whole Workers to Agent Servers shift. IDK)
I am also curious why you are using such an old version of agents 1.3
As for the deps: I just didn’t touch this code for a while + also tend to go through the changelogs before upgrading nowadays, since last time when upgrading to 1.3 I hit some annoying breaking changes (namely caused by that shift from workers to agent servers) that broke some parts of my codebase, which I had to rewrite a bit.
So a combination of being careful and a lack of time. I’ll make sure to upgrade soon, though ![]()
PS: And thanks again for your time, @CWilson!