Hi team, We're experiencing an issue where the sam...
# agents
a
Hi team, We're experiencing an issue where the same job.id appears to be dispatched twice to the same room. Here's what we observed in our logs:
Copy code
Timeline:
14:53:22 - [JOB:AJ_FxE7xhip4M8t] entrypoint() called (first time)
14:54:12 - Warm transfer completed successfully
14:54:14 - Agent session closed via session.aclose()
14:55:22 - [JOB:AJ_FxE7xhip4M8t] entrypoint() called (second time) ← Same job ID!
Context: • We're running a voice agent that handles inbound SIP calls • After a successful warm transfer, we call await self.session.aclose() to close the agent session • The room still has participants (original caller + transfer target) after the agent leaves • About 1 minute later, our entrypoint function gets called again with the same job ID • The second dispatch fails because it tries to get agent_id from participant metadata, but the participant is now the transfer target (who doesn't have agent metadata) Questions: 1. Is it expected behavior for LiveKit to re-dispatch an agent to a room when the agent leaves but participants remain? 2. If so, does it reuse the same job.id or create a new one? 3. What's the recommended way to prevent re-dispatch after a warm transfer? Should we update room metadata, delete the room, or handle this differently?
r
Are you running a named agent and a default agent?
a
@refined-appointment-81829 I'm using a named agent
r
So you do not have any agent running that are not named?
a
@refined-appointment-81829 yeah that's right
r
Looking in the logs I do not see a second dispatch for the agent.