delightful-planet-44653
12/23/2025, 2:39 PMtall-airline-16756
12/23/2025, 2:39 PMtall-airline-16756
12/23/2025, 2:39 PMagent_name. Single workers cause availability gaps and lost dispatches.
• Check cluster/host counts and scale workers up if you see high dispatch volume.
1. Check agent registration & connectivity
• Verify each agent server successfully registers with the LiveKit control plane and stays connected.
• Look for network issues or firewall rules blocking agent ↔️ LiveKit communication.
1. Inspect agent load and resource usage
• Monitor CPU, memory, disk, and network on agent hosts. High load or crashes can drop acceptances.
• Don’t run other heavy apps on the same hosts as agents.
1. Review on_request / acceptance logic
• If you implemented on_request, confirm it calls req.accept() (and not rejecting unintentionally).
• If you rely on default behavior, know that agents auto-accept unless on_request overrides it.
1. Look for timeouts during job startup
• There’s a short window for agents to connect to a room after dispatch. Slow startup, heavy entrypoints, or network latency can cause timeouts and failed deliveries.
1. Use logs & observability
• Enable DEBUG/INFO logs to track dispatch creation, routing, and acceptance events.
• Check agent-side logs for rejected requests, errors, or crashes.
• Use Agent Observability (if enabled) to inspect session traces and failed dispatches.
1. Verify dispatch configuration and rules
• Confirm dispatch rules, agent names, and metadata match exactly. Misconfigured filters can route away many requests.
• For room-based or SIP dispatches, ensure the correct RoomAgentDispatch names and tokens are used.
1. Watch for queueing/backpressure and scale dynamically
• Inspect dispatch queue depth and any backpressure metrics.
• Implement auto-scaling (Kubernetes or similar) to add workers under high load.
Diagnostic actions to run now
1. Pull agent logs for the time range when requests were created and search for connection failures, rejects, or crashes.
2. Count registered/available workers vs dispatched jobs at that time.
3. Check metrics: CPU/memory, network errors, and dispatch queue length.
4. Confirm whether on_request is present and whether it accepted or rejected requests.
If you can share:
• whether you run multiple workers per agent name,
• recent agent logs or error snippets,
• and whether on_request is implemented,
I can help interpret logs and recommend targeted fixes.
Sources: Agents Framework | livekit/livekit_composite | DeepWiki | How to Get Help from LiveKit | Agent server options | LiveKit docs | https://blog.livekit.io/streamline-troubleshooting-with-agent-observability/#/portal/signup| | Agent dispatch | LiveKit docsdelightful-planet-44653
12/23/2025, 2:43 PMno workers with sufficient capacity but only for 2% of the dispatch requests.tall-airline-16756
12/23/2025, 2:43 PMrequest_fnc shows agents received ~20% of dispatches, and server logs show no workers with sufficient capacity for only ~2% of dispatches. To narrow this down I need a few details and will suggest targeted checks.
Quick clarifying questions
• How many workers are running per agent_name during the incident? Any autoscaling in place?
• Do you implement an on_request handler in agents? If so, does it sometimes reject requests or short-circuit req.accept()?
• Are agents evenly distributed across hosts/regions, or concentrated on a few machines?
• Do you see any agent-side errors or crashes in the agent logs for the same timeframe?
• Are there any rate limits, proxies, or load balancers between LiveKit and agents?
Immediate checks to run now
1. Correlate timestamps: Compare dispatch-created timestamps with agent log timestamps to see whether requests reached agents but were dropped/ignored.
2. Search agent logs for any rejected requests, exceptions, or long GC/startup pauses around dispatch times.
3. Count registered workers vs dispatched jobs at peak times (snapshot): if registered workers << concurrent dispatches, many requests may be queued/dropped before capacity checks log appears.
4. Inspect on_request code paths for conditional rejections, early returns, or long synchronous work that prevents calling req.accept() quickly.
5. Check network/connectivity metrics and LB/proxy logs for connection resets, timeouts, or 503s between control plane and agents.
6. Review resource metrics (CPU, memory, thread pools) for agents — look for saturation that would prevent request handling without emitting “no workers” on server.
7. Increase agent log level to DEBUG for a short window and capture a representative sample of dispatches.
What to share if you want me to dig deeper
• Small snippets from agent logs around a few missed dispatch timestamps.
• The on_request handler (or confirmation that default auto-accept is used).
• Worker counts per agent_name and any autoscaling config.
• Any load balancer/proxy between LiveKit and agents.
Send one or two log snippets and the on_request info and I’ll correlate and point to the most likely root cause and next fix.adorable-petabyte-73906
12/23/2025, 2:44 PMtall-airline-16756
12/23/2025, 2:45 PMakshat)?
Also please confirm:
• Are you running LiveKit’s AgentServer binary/library (official agent) or a custom agent implementation?
• If it’s the official AgentServer, which version are you running?
If you can answer those, please also attach:
• A short agent log snippet around a missed dispatch timestamp, and
• Your on_request handler (or state that you use default auto-accept).
With that I’ll correlate logs and code paths and suggest the next targeted checks.delightful-planet-44653
12/23/2025, 3:06 PMno workers should match the number of dropped requests in livekit server logs.
That count itself is 20% of the total dispatch requests created. Could be an issue with livekit server?tall-airline-16756
12/23/2025, 3:06 PMno workers with sufficient capacity only for ~2% of dispatches, and
• You suspect the LiveKit server may be dropping ~78% of dispatches before they appear to agents.
This narrows possibilities. A few targeted checks and short diagnostics will quickly show whether the server is the culprit or something else is filtering/losing requests.
Quick checks to run now
1. Correlate dispatch-created logs with server-side dispatch lifecycle
• From the LiveKit server logs, pick a short timeframe (eg. 60–120s) with high dispatch volume.
• For each dispatch created, confirm the server emitted any lifecycle log (queued/routed/assigned/failure). If many creations have no follow-up lifecycle logs, the server is dropping them before routing.
1. Check server-side rate limiting / queue/drop metrics
• Look for any server metrics about dispatch queue depth, rejected/dropped dispatches, or internal rate limits. If these counters spike matching the missing percentage, the server is the source.
1. Search server logs for other failure reasons
• Besides no workers with sufficient capacity, search for errors like authentication failures, dispatch rule evaluation errors, datastore timeouts, or internal panics around the missing dispatch timestamps.
1. Verify dispatch routing & rule evaluation
• Confirm the dispatch criteria/metadata used when creating dispatches exactly matches agent metadata and routing rules. If rules filter most requests, the server may drop or route them elsewhere without emitting the specific capacity message.
1. Confirm persistence/store acknowledgements
• If LiveKit uses a backing store or queue for dispatches, check whether dispatch writes succeeded (ack/nack) in the server logs or store logs.
1. Increase server log level & capture a sample
• Temporarily set LiveKit server logging to DEBUG for a 1–2 minute window at peak traffic and capture all dispatch-related logs. That will show why most dispatches never reach agents.
Targeted data I can help analyze
• A small sample (10–20) of dispatch IDs and their exact creation timestamps.
• The LiveKit server log slice covering those timestamps.
• Any server metrics about dispatch queue/rejections for that timeframe.
• The dispatch creation payload (metadata/routing criteria) for a few examples.
If you can share those (IDs + server log slice), I’ll correlate creation -> server lifecycle and point to the exact failure reason and next fix.delightful-planet-44653
12/23/2025, 3:08 PMtall-airline-16756
12/23/2025, 3:08 PMadorable-petabyte-73906
12/23/2025, 3:32 PMtall-airline-16756
12/23/2025, 3:32 PMno workers with sufficient capacity log should be rare and match actual capacity issues only.
• Redis metrics should remain stable (no slow commands or errors).
If autoscaling does not close the gap
• Collect a sample of dispatch IDs and server log slices for those timestamps, plus Redis INFO/slowlog and LiveKit server resource metrics. I’ll correlate them and point to the remaining bottleneck.
If you want, tell me:
• how you currently deploy LiveKit (K8s, VM, ECS), and
• the autoscaling metric you plan to use (CPU, mem, or a custom metric) —
and I’ll give a short checklist tuned to that environment.