fancy-painting-20947
09/16/2025, 4:27 AMtall-airline-16756
09/16/2025, 4:27 AMtall-airline-16756
09/16/2025, 4:28 AMagent_name field directly in the agent’s code. This isn’t something that can be done through the connect CLI command, but don’t worry—I’m here to help you through it! Here’s a simple way to set the agent name: 1. Update the agent’s entry point code. 2. Add the agent_name parameter inside the WorkerOptions when you call cli.run_app(). For example, in Python:
if __name__ == "__main__":
cli.run_app(
WorkerOptions(
entrypoint_fnc=entrypoint,
agent_name="custom-agent-name",
),
)
Once you’ve named your agent, you can easily dispatch it to rooms using the LiveKit API or other approaches. If you have any questions or need a hand with this setup, just let me know—I’m happy to assist! Sources: Dispatching agents | LiveKit Docs | Accepting incoming calls | LiveKit Docs | Accepting incoming calls | LiveKit Docs | examples/agent_dispatch.py | Making calls using SIP | LiveKit Docsfancy-painting-20947
09/16/2025, 5:37 AMtall-airline-16756
09/16/2025, 5:38 AMagent_name parameter is set correctly in the WorkerOptions? Also, it would be great to confirm if the agent is being dispatched explicitly to the room. If you’ve noticed any errors or logs during the agent’s connection process, sharing those would really help us get to the bottom of this together!fancy-painting-20947
09/16/2025, 5:45 AMif __name__ == "__main__":
# Run the CLI worker - it will automatically handle dispatch requests from LiveKit API
cli.run_app(WorkerOptions(
agent_name="interviewer",
prewarm_fnc=prewarm,
entrypoint_fnc=entrypoint
))
This is the main of my agent entry point script.tall-airline-16756
09/16/2025, 5:46 AMagent_name in your script looks like it’s set correctly, which is great! Let’s explore a few possible reasons why the agent might still be receiving random names, just to make sure everything is on track: 1. Mismatch in Agent Name Configuration: It’s important to double-check that the agent_name matches exactly in both the WorkerOptions and any dispatch rules or API calls you’re using to assign the agent to a room. 2. Automatic Dispatch Still Enabled: Keep in mind that setting agent_name actually disables automatic dispatch. This means the agent will only join rooms if they’re explicitly dispatched through the AgentDispatchService API. 3. Incorrect Dispatch Method: Make sure you’re using the AgentDispatchService.create_dispatch() method to explicitly dispatch the agent to a room. Also, verify that both the agent_name and room name are correct. 4. Environment or Credential Issues: It’s a good idea to confirm that the worker has the right credentials (apiKey, apiSecret, wsURL) to register properly with the LiveKit server. 5. Worker Not Running or Registered: Lastly, please ensure the worker is actively running and connected to the LiveKit server. If the worker isn’t started or loses connection, the agent_name won’t be recognized. I hope these pointers help! Please feel free to check these areas, and don’t hesitate to reach out if the issue continues or if you’d like me to walk through anything together. I’m here to help! Sources: SIP troubleshooting guide | LiveKit Docs | Dispatching agents | LiveKit Docs | Agent dispatch | LiveKit Docs | agents/src/worker.tsfancy-painting-20947
09/16/2025, 5:47 AMscript_name = f"{agent_type}_worker.py"
return subprocess.Popen([
sys.executable,
str(current_dir / script_name),
"connect",
"--room", room_name,
# "--participant-identity", agent_type,
])
This is how i am running this script. so for interviewer it will be like python3 interviewer_worker.py connect --room 23r4-s4j5tall-airline-16756
09/16/2025, 5:48 AMagent_name set in WorkerOptions is actually respected and not ignored when you use CLI commands like connect. However, it’s important to note that the connect command by itself doesn’t automatically send the agent to a room unless you have explicit dispatch set up. To make sure your agent joins the room with the right name, here are a few friendly steps you can follow: 1. Double-check that the agent_name in your WorkerOptions matches the name used in any dispatch rules or API calls. 2. Use the AgentDispatchService.create_dispatch() method to explicitly dispatch your agent to the room. 3. Make sure your worker is running with the correct credentials and is properly connected to the LiveKit server. If you’re running the connect command directly, it might not trigger the dispatch logic needed for named agents. Please feel free to reach out if you’d like me to walk you through this or if you have any other questions—I’m here to help! Sources: livekit-agents/livekit/agents/worker.py | agents/src/worker.ts | Making calls using SIP | LiveKit Docs | Making calls using SIP | LiveKit Docs | Agents telephony integration | LiveKit Docs