tall-librarian-71494
09/12/2025, 8:37 PMsession = AgentSession[InterviewSessionData](
stt=NOT_GIVEN,
tts=NOT_GIVEN,
vad=NOT_GIVEN,
llm=openai.realtime.RealtimeModel(
voice="alloy",
model="gpt-realtime",
temperature=0.6,
turn_detection=openai.realtime.realtime_model.TurnDetection(
eagerness="low",
type="semantic_vad",
),
input_audio_transcription=openai.realtime.realtime_model.InputAudioTranscription(
model="gpt-4o-mini-transcribe",
language="en",
),
speed=1.0
)
turn_detection='realtime_llm',
allow_interruptions=True,
discard_audio_if_uninterruptible=True,
min_interruption_duration=0.5,
min_interruption_words=0,
min_endpointing_delay=0.4,
max_endpointing_delay=6.0,
min_consecutive_speech_delay=0.0
)
We keep seeing errors like this after a while
"Running <Task pending name='Task-20188' coro=SpeakingRateStream._main_task() running at /root/.local/lib/python3.12/site-packages/livekit/agents/utils/log.py:16 wait_for=Future pending cb=[Task.task_wakeup()] cb=[SpeakingRateStream.__init__.locals.lambda() at /root/.local/lib/python3.12/site-packages/livekit/agents/voice/transcription/_speaking_rate.py:66]> took too long: 4.00 seconds"
Which then leads to spam like this with a few seconds between messages
2025-09-12T18:07:01.096Z
{"message": "worker is at full capacity, marking as unavailable", "level": "INFO", "name": "livekit.agents", "load": 0.7097309168000004, "threshold": "_WorkerEnvOption(dev_default=inf, prod_default=0.7)", "timestamp": "2025-09-12T18:07:01.096315+00:00"}
2025-09-12T18:07:03.876Z
{"message": "worker is below capacity, marking as available", "level": "INFO", "name": "livekit.agents", "load": 0.6279540712000005, "threshold": "_WorkerEnvOption(dev_default=inf, prod_default=0.7)", "timestamp": "2025-09-12T18:07:03.875975+00:00"}
2025-09-12T18:07:19.347Z
{"message": "worker is at full capacity, marking as unavailable", "level": "INFO", "name": "livekit.agents", "load": 0.7694618414000004, "threshold": "_WorkerEnvOption(dev_default=inf, prod_default=0.7)", "timestamp": "2025-09-12T18:07:19.346754+00:00"}
2025-09-12T18:07:21.873Z
{"message": "worker is below capacity, marking as available", "level": "INFO", "name": "livekit.agents", "load": 0.6999146682000005, "threshold": "_WorkerEnvOption(dev_default=inf, prod_default=0.7)", "timestamp": "2025-09-12T18:07:21.873386+00:00"}
2025-09-12T18:07:42.334Z
{"message": "worker is at full capacity, marking as unavailable", "level": "INFO", "name": "livekit.agents", "load": 0.7174924972000004, "threshold": "_WorkerEnvOption(dev_default=inf, prod_default=0.7)", "timestamp": "2025-09-12T18:07:42.334188+00:00"}
2025-09-12T18:07:44.846Z
{"message": "worker is below capacity, marking as available", "level": "INFO", "name": "livekit.agents", "load": 0.6934305794000004, "threshold": "_WorkerEnvOption(dev_default=inf, prod_default=0.7)", "timestamp": "2025-09-12T18:07:44.845841+00:00"}
2025-09-12T18:07:58.019Z
{"message": "worker is at full capacity, marking as unavailable", "level": "INFO", "name": "livekit.agents", "load": 0.7475017008000006, "threshold": "_WorkerEnvOption(dev_default=inf, prod_default=0.7)", "timestamp": "2025-09-12T18:07:58.018947+00:00"}
2025-09-12T18:08:03.112Z
{"message": "worker is below capacity, marking as available", "level": "INFO", "name": "livekit.agents", "load": 0.6091444522000005, "threshold": "_WorkerEnvOption(dev_default=inf, prod_default=0.7)", "timestamp": "2025-09-12T18:08:03.112315+00:00"}
2025-09-12T18:08:05.735Z
{"message": "worker is at full capacity, marking as unavailable", "level": "INFO", "name": "livekit.agents", "load": 0.7143783202000005, "threshold": "_WorkerEnvOption(dev_default=inf, prod_default=0.7)", "timestamp": "2025-09-12T18:08:05.735453+00:00"}
2025-09-12T18:08:10.801Z
{"message": "worker is below capacity, marking as available", "level": "INFO", "name": "livekit.agents", "load": 0.6931043136000004, "threshold": "_WorkerEnvOption(dev_default=inf, prod_default=0.7)", "timestamp": "2025-09-12T18:08:10.801046+00:00"}
2025-09-12T18:08:13.489Z
{"message": "worker is at full capacity, marking as unavailable", "level": "INFO", "name": "livekit.agents", "load": 0.7137814910000004, "threshold": "_WorkerEnvOption(dev_default=inf, prod_default=0.7)", "timestamp": "2025-09-12T18:08:13.489098+00:00"}
2025-09-12T18:08:16.264Z
{"message": "worker is below capacity, marking as available", "level": "INFO", "name": "livekit.agents", "load": 0.6262047228000005, "threshold": "_WorkerEnvOption(dev_default=inf, prod_default=0.7)", "timestamp": "2025-09-12T18:08:16.263768+00:00"}
I suspect this is due to us using aws ecs with fargate, and running out of burstable cpu credits, but even then as long as we are running openai realtime then I would assume the load on the agent server is minimal as realtime handles vad and transcripts for us? Worth noting the metrics for the ecs fargate task show usage equal to 1vcpu at 100%, so for example a 4vcpu task would be at ~25% usage while this occurs. We also only recently encountered this issue. We added the ability to dynamically configure the agent to run using a stt-llm-tts pipeline, which also meant optionally enabling things like silero per session, after which we started running into these issues intermittently.witty-dentist-65028
09/13/2025, 7:25 AMtall-librarian-71494
09/14/2025, 7:27 PMtranscription/_speaking_rate.py:66 happens where the task takes too long, and after that we observe degraded performance and the agent thinking it is out of capacity, this time we also observe lots of;
2025-09-14T18:40:40.504Z
{"message": "job executor is unresponsive", "level": "WARNING", "name": "livekit.agents", "delay": 1510, "tid": 397, "timestamp": "2025-09-14T18:40:40.504017+00:00"}
2025-09-14T18:40:40.504Z
{"message": "job executor is unresponsive", "level": "WARNING", "name": "livekit.agents", "delay": 640, "tid": 440, "timestamp": "2025-09-14T18:40:40.504195+00:00"}
2025-09-14T18:40:41.281Z
{"message": "job executor is unresponsive", "level": "WARNING", "name": "livekit.agents", "delay": 1396, "tid": 379, "timestamp": "2025-09-14T18:40:41.280958+00:00"}
The usage sits neatly at 25% of a 4vcpu compute optimized machine, once an agent reaches this state we can only restart it to resolve the problem, it never recovers on its own.witty-dentist-65028
09/14/2025, 7:31 PMwitty-dentist-65028
09/15/2025, 5:25 AMtall-librarian-71494
09/15/2025, 8:55 AMjolly-air-155
09/15/2025, 9:16 AMRoomOutputOptions.sync_transcription=False?tall-librarian-71494
09/15/2025, 9:31 AMjolly-air-155
09/15/2025, 9:35 AMtall-librarian-71494
09/16/2025, 9:45 AMproud-leather-89518
09/17/2025, 4:36 AM_WorkerOptions._multiprocessing_context=spawn). Below is the exported files. Both the speedscope and chrometrace states that the _`_wait_buffered_audio`_ keep taking the main event loop. Do we have any solution for them?tall-librarian-71494
09/17/2025, 7:35 AMjolly-air-155
09/17/2025, 7:46 AMjolly-air-155
09/17/2025, 7:47 AMproud-leather-89518
09/17/2025, 12:18 PMtall-librarian-71494
09/17/2025, 12:36 PMproud-leather-89518
09/24/2025, 10:10 AMAgentSession.resume_false_interruption = false? Perhaps I found the issue.tall-librarian-71494
09/24/2025, 10:12 AMtall-librarian-71494
09/24/2025, 10:12 AM