wooden-librarian-60399
03/02/2026, 3:44 AMtall-airline-16756
03/02/2026, 3:44 AMtall-airline-16756
03/02/2026, 3:44 AMagent_name: This creates failover within the same agent group and improves availability.
Quick diagnostics to run now
1. Run lk agent status to check replica counts and agent health.
2. Check agent server CPU/memory usage during call attempts to spot resource bottlenecks.
3. Look for logs around the SIP inbound time window for any errors showing room connection timeouts or delays (the 10s connection window is the key indicator).
If you’d like, I can help next with any of the following:
• Walk through interpreting lk agent status output (paste it here).
• Suggest autoscaling thresholds for your deployment pattern (tell me typical concurrent calls and agent machine size).
• Review agent/server logs if you can share relevant excerpts around a failed call attempt (timestamps help).
Which diagnostic would you like to try first, or can you share lk agent status output and a brief description of your deployment (number of agents/replicas, machine sizes, and whether autoscaling is enabled)?
Sources: examples/drive-thru | livekit/livekit_composite | DeepWiki | Agents Framework | livekit/livekit_composite | DeepWikiwooden-librarian-60399
03/02/2026, 3:53 AMtall-airline-16756
03/02/2026, 3:53 AMconnectionTimeout value. It determines how long the agent waits for a participant to join the room before failing the incoming SIP call.
How to change it
1. Set ctx.proc.connectionTimeout in your agent entry before the room join attempt.
2. Example (TypeScript):
export default defineAgent({
entry: async (ctx: JobContext) => {
// Increase timeout to 60 seconds
ctx.proc.connectionTimeout = 60;
// ...rest of your agent logic
}
});
Guidance on choosing a value
• Short timeouts (10s) reduce waiting time for truly failed attempts but can cause missed answers when network or backend delays occur.
• Increasing to 30–60 seconds is a common mitigation for intermittent network or provisioning delays.
• Avoid extremely large values unless you expect long setup delays, since callers will wait longer for a failed answer.
Next steps I can help with
• Recommend a timeout value based on your typical SIP setup and observed delays (tell me your average SIP setup time or concurrent call counts).
• Review logs around failed calls to confirm whether increasing the timeout will help.
Which would you like to do next?
Sources: Agents (Python) | livekit/livekit_composite | DeepWikiwooden-librarian-60399
03/02/2026, 3:57 AMtall-airline-16756
03/02/2026, 3:58 AMctx.proc.connectionTimeout to 30–60 seconds can prevent those calls from being treated as failed and reduce missed answers.
• In short: increasing the timeout helps when the bottleneck is the room/participant joining step finishing within the agent that has already accepted the job.
When increasing the timeout won’t help
• If the real problem is that no agent accepts the job within 10s because you have too few replicas, overloaded servers, or autoscaling is slow/misconfigured, then increasing the per-job connection timeout only delays failure detection — it does not create additional agent capacity. In that case you need to address agent availability (more replicas/instances, dedicated resources, faster autoscaling).
Recommended approach
• Run both mitigations together:
◦ Short-term: increase ctx.proc.connectionTimeout (e.g., 30–60s) to avoid losing calls due to transient room-join delays.
◦ Medium/long-term: ensure enough agent replicas and resource capacity so an agent accepts the job promptly. Use lk agent status, monitor CPU/memory, and tune autoscaling or run multiple worker instances per agent_name.
• If you’re unsure which is the dominant issue for your environment, check these diagnostics:
a. Did an agent accept the job? (Agent logs / lk agent status around the incoming call time.)
b. If accepted, are there logs showing room-join attempts and timing? Look for timestamps showing how long room join took.
c. If no agent accepted the job, inspect replica counts and resource usage during the call arrival window.
If you want, I can help interpret lk agent status output or sample logs — paste the output or a log excerpt with timestamps and I’ll point out whether the failures look like agent-availability problems or room-join timeouts. Which diagnostics would you like to run first?