my agent is not joining room when created by a cli...
# ask-ai
c
my agent is not joining room when created by a client, why?
t
Thanks for reaching out, ZaidKaraymeh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
There are several potential reasons why an agent might fail to join a room created by a client in LiveKit. Here are the most common causes and troubleshooting steps: • Worker Rejection or Timeout: When a room is created, the server notifies a registered worker to handle the job. If the worker rejects the job or does not respond within the timeout period, the server will try other workers. If all workers reject or timeout, the agent will not join the room. • Explicit Dispatch Configuration Issues: If you have configured explicit dispatch by setting an
agent_name
in your WorkerOptions, agents will not be automatically dispatched to new rooms. In this case, you need to explicitly dispatch the agent using the AgentDispatchService API or configure dispatch in the participant's access token. • No Available Workers: If no workers are registered and available when the room is created, there will be no agents to dispatch. • Connection Failures: Network connectivity issues can prevent agents from successfully joining rooms. Agents may need to make multiple reconnect attempts to establish a connection. To resolve this issue, please check the following: 1. Ensure that workers are properly registered and available when rooms are created. 2. Verify your dispatch configuration, especially if you are using explicit dispatch settings. 3. Check for any network connectivity issues that might be affecting the agent's ability to join the room. 4. Monitor connection events and provide appropriate feedback to users if agents fail to join. If you need further assistance, let me know the specific configuration or error messages you are encountering, and I can provide more targeted guidance. Sources: README.md | Dispatching agents | LiveKit Docs | pkg/loadtester/agentloadtester.go | Web and mobile frontends | LiveKit Docs