clean-horse-59133
12/16/2025, 1:43 PMtall-airline-16756
12/16/2025, 1:43 PMtall-airline-16756
12/16/2025, 1:44 PMclean-horse-59133
12/16/2025, 1:50 PMtall-airline-16756
12/16/2025, 1:50 PMagent_name on your agent server so agents only join when explicitly dispatched.
◦ Example: @server.rtc_session(agent_name="inbound-agent") (Python) or new WorkerOptions({ agentName: "inbound-agent" }) (Node).
• Update your SIP dispatch rule to list specific agents in room_config.agents or use tokens / API CreateAgentDispatchRequest to dispatch explicitly.
• Ensure rooms are closed/deleted when the job ends, or perform a graceful shutdown with session.shutdown() / ctx.shutdown() so no orphaned room triggers dispatch.
• Prevent unintended re-registration/restarts of the agent server which can trigger new dispatches.
Would you like help changing to explicit dispatch or reviewing your SIP dispatch rule? If so, share the dispatch rule or the minimal sequence that leads to the new job being created.
Sources: Agent dispatch | LiveKit docs | SIP dispatch rule | LiveKit docs | Job lifecycle | LiveKit docsclean-horse-59133
12/16/2025, 1:53 PMtall-airline-16756
12/16/2025, 1:53 PMagent_name in the dispatch rule. That’s a good step toward explicit dispatch. To help find why a new agent still joins after killing the job, please share the following so I can diagnose:
1. The SIP dispatch rule snippet (the part that includes agent_name / room_config.agents).
2. Whether your agent server process restarts or re-registers after the job is killed.
3. Whether the room remains active after the job is killed (any participants or room not deleted).
4. Any relevant logs around the time the new job is created (agent dispatch events or server registration messages).
If you prefer, paste just the minimal dispatch rule and a short log excerpt showing the new dispatch; I’ll point out exactly what to change.clean-horse-59133
12/16/2025, 1:54 PMtall-airline-16756
12/16/2025, 1:54 PMroomConfig.agents with agentName: "voice-stage-temp".
Next steps to stop new agents joining the same room after you kill the job:
1. Ensure your agent process is configured with the same agent name so it runs in explicit-dispatch mode:
◦ Python: @server.rtc_session(agent_name="voice-stage-temp")
◦ Node: set agentName: "voice-stage-temp" in your AgentServer/WorkerOptions
1. Confirm the agent process is not restarting or re-registering after the job is killed. If it restarts, explicit dispatch will still allow it to accept dispatched jobs.
2. Make sure the room is closed or you perform a graceful shutdown when a job ends (call session.shutdown() / ctx.shutdown()), so the room doesn't remain active and trigger another dispatch.
If you already have agent_name set in your agent code and still see a new agent join, please paste:
• The agent startup snippet showing agent_name (or WorkerOptions), and
• A short log around the time the job is killed and the new dispatch occurs.
I’ll pinpoint the mismatch.clean-horse-59133
12/16/2025, 1:56 PMtall-airline-16756
12/16/2025, 1:56 PMagentName: "voice-prod" or configure your agent process to use agent_name="voice-stage-temp" so explicit dispatch is honored.
• After aligning, ensure the agent process isn't auto-restarting or re-registering unexpectedly and that you perform graceful shutdown (session.shutdown() / ctx.shutdown()) when jobs end.
Please paste your agent startup snippet (where you set agentName / agent_name) and I’ll confirm the exact change.clean-horse-59133
12/16/2025, 1:57 PMtall-airline-16756
12/16/2025, 1:57 PMagent_name: "voice-prod" and you confirm the dispatch rule uses voice-prod. That means the new agent joining is expected under explicit dispatch when a dispatch request is sent while the room still exists.
Possible causes and what to check (pick applicable items):
• Confirm your agent process is started with agent_name="voice-prod" so it runs in explicit-dispatch mode (Python @server.rtc_session(agent_name="voice-prod") or Node agentName: "voice-prod").
• Check whether something is sending a new dispatch request after the process is killed (SIP gateway, re-register, or retry logic). The log line "received job request" shows a new dispatch was issued for that job_id/dispatch_id.
• Verify the room remains active after the kill; if the room is still present, a subsequent dispatch will join the same room. Ensure you perform graceful shutdown (session.shutdown() / ctx.shutdown()) or delete/close the room when the job ends.
• Ensure the agent process itself is not restarting automatically (supervisor/container restart) which could accept dispatches again.
If you want, I can:
• Review your agent startup snippet to confirm agent_name is set correctly, or
• Help inspect logs for the component issuing the dispatch (share the preceding log lines around the new dispatch).
Which would you like me to do next?clean-horse-59133
12/16/2025, 1:58 PMtall-airline-16756
12/16/2025, 1:58 PMroomConfig.agents and does not rely on global automatic assignment).
• Ensure the agent process is configured with the matching agent_name (e.g., voice-prod) so it runs in explicit-dispatch mode and only accepts dispatches targeted to it.
• Prevent the SIP server from retrying dispatch on failures—check SIP gateway/retry settings so it doesn’t re-issue dispatches when an agent process is killed.
• Clean up the room on job end or perform a graceful shutdown (session.shutdown() / ctx.shutdown()), so the room isn’t left active and retriggered for dispatch.
If you’d like, I can:
• Show an example SIP dispatch rule configured for explicit dispatch, or
• Review the SIP server’s dispatch/retry logs (paste a short excerpt) to identify what component issued the subsequent dispatch.
Which help would you prefer?clean-horse-59133
12/16/2025, 1:59 PMtall-airline-16756
12/16/2025, 2:00 PMroomConfig.agents (you already have this). This prevents generic auto-assignment but does not stop the SIP server from re-dispatching the listed agent while the room exists.
• Ensure agent runs in explicit-dispatch mode: start your agent with the matching name so it only accepts explicit dispatches.
◦ Python: @server.rtc_session(agent_name="voice-prod")
◦ Node: set agentName: "voice-prod" in AgentServer/WorkerOptions
• Prevent SIP retry/re-dispatch: check SIP gateway/retry settings so the SIP server does not re-issue dispatches when an agent is killed or becomes unresponsive.
• Clean up the room / graceful shutdown: when a job is terminated, call session.shutdown() / ctx.shutdown() or delete/close the room so the SIP server does not see an active room to re-dispatch against.
If you want, I can:
• Show a minimal example SIP dispatch rule for explicit dispatch, or
• Inspect the SIP dispatch/retry logs if you paste the log lines around the dispatch request (especially entries preceding "received job request").
Which would you like me to help with?