nutritious-church-949
03/27/2026, 6:30 PMtall-airline-16756
03/27/2026, 6:31 PMtall-airline-16756
03/27/2026, 6:31 PMagent_name) in the agent code or in the developer page — that identifies which agent instance will receive jobs.
• Ensure your client uses explicit dispatch (by including the target agent in room config / token or using a dispatch rule/CLI) so the room is routed to that named agent.
What to check to identify which agent you’re using
• Agent name in the agent process: look for the agent_name value used when the agent is registered (for example, the name set in the rtc_session decorator in your agent code). That name is the canonical identifier for that agent.
• Developer page / agent list: agents created there can have distinct names. Any agent with a name will only receive jobs when explicitly dispatched to that name.
• If an agent has no name, it participates in the default automatic dispatch and can receive any jobs assigned by default dispatch.
How to ensure your client app talks to a specific (working) agent
1. Explicit dispatch by agent name (recommended)
◦ When creating or joining a room from your server, include the named agent in the room config so the created room is dispatched to that agent. For example, set the room’s agents field to include the agent_name.
◦ When creating access tokens, include the room config that targets the named agent so clients using that token connect to the intended agent.
1. Use a dispatch rule for SIP or other flows
◦ For SIP or other configured dispatch flows, set the dispatch rule’s agents to reference the named agent you want to handle those calls.
1. Use the CLI to dispatch to a specific agent (useful for testing)
◦ You can run a dispatch command that targets the agent name and a specific room (for example: lk dispatch create --agent-name my-agent --room my-room).
1. Use unique names per developer or separate projects to avoid crosstalk
◦ Give each developer or environment a unique agent_name (for example by appending a suffix via an env var) so your local/dev agent won’t be accidentally used by others.
◦ If you need full isolation, use separate LiveKit projects so credentials, rooms, and agents are entirely separated.
Notes about load balancing and multiple instances
• If you deploy multiple instances with the same agent name, jobs will be load-balanced across those instances.
• Named agents do not receive jobs automatically unless they are explicitly targeted by dispatch rules, room config, or token room configuration.
If you want, I can help with the exact step-by-step for your setup:
• Tell me whether you’re using tokens created server-side, SIP dispatch rules, or the CLI to create rooms.
• Share the agent_name you expect to use (or the snippet where you register the agent) and the way your client obtains room tokens — I’ll give the precise config or token payload to guarantee routing to that agent. Sources: Why do jobs stop after agent rejection? | LiveKit | Avoiding crosstalk when multiple developers share a LiveKit project | LiveK..., with interactive elementsnutritious-church-949
03/27/2026, 6:35 PMtall-airline-16756
03/27/2026, 6:35 PMagent_name string you gave the agent when you registered/deployed it (for example, my-agent-jack).
2) Update the sandbox token server to include the agent in the room config
• Locate where the sandbox token server builds the access token or room creation payload. Add the room configuration (or agents list) with the target agent_name so the token forces dispatch to that agent.
• Typical pattern (pseudo-code form — adapt to the language in your sandbox server):
◦ Include an agents array in the room config: agents: [{ agent_name: "my-agent-jack" }]
◦ Or when building the access token, attach the room configuration that includes agents=[RoomAgentDispatch(agent_name=AGENT_NAME)].
• This ensures any client using that token will be dispatched to the named agent rather than relying on default automatic dispatch.
3) Confirm the SwiftUI frontend uses the token from that token server
• The SwiftUI example fetches a token from the sandbox token server and uses it to connect. No client-side change is required beyond ensuring it’s calling the updated token endpoint.
• Verify the frontend’s network call is pointing at your modified sandbox server URL and not a different token server.
4) Verify the connection reached the intended agent
• Check the agent logs for an incoming job or RTC session that references the agent_name and the room name used by the SwiftUI client.
• If you have multiple instances with the same agent name, jobs will be load-balanced across those instances; if you need a single process, use a unique name per instance.
If you’d like, I can give exact code snippets for the sandbox token server you’re running:
• Tell me which language your sandbox token server is implemented in (Swift, Node, Python, etc.) and the current token creation snippet.
• Also share the agent_name you want to target and the room name pattern you’re using. I’ll provide the precise changes to add the agent dispatch configuration to the token., with interactive elements