TTSSegmentsForwarder ERROR- agent stops speaking after this for 2-3 seconds. Facing this issue randomly.
{"message": "Task was destroyed but it is pending!\ntask: <Task pending name='Task-122' coro=<TTSSegmentsForwarder._main_task() running at /home/appuser/.local/lib/python3.12/site-packages/livekit/agents/utils/log.py:16> wait_for=<Future pending cb=[Task.task_wakeup()]>>", "level": "ERROR", "name": "asyncio", "pid": 166, "job_id": "AJ_yWi3pGCRRnqW", "timestamp": "2024-09-26T08:20:38.011601+00:00"}
same issue here!
hey we're experiencing the same issue - which version are you using?
Could you share additional logs around this line? that'd be helpful to see the context that has led to this (feel free to blank out any transcriptions)
The only logs we got was this error above, over and over again. It seems that settings preemptive_synthesis=False stops this error from happening.
2024-09-27 09:34:13.034 PDT
Task was destroyed but it is pending! task: <Task pending name='Task-3420' coro=<TTSSegmentsForwarder._main_task.<locals>._forward_task() running at /home/appuser/.local/lib/python3.11/site-packages/livekit/agents/utils/log.py:16> wait_for=<Future pending cb=[Task.task_wakeup()]>>
2024-09-27 09:57:11.436 PDT
2024-09-27 16:57:11,437 - asyncio - ERROR - Task was destroyed but it is pending!
2024-09-27 09:57:11.437 PDT
2024-09-27 16:57:11,438 - asyncio - ERROR - Task was destroyed but it is pending!
2024-09-27 09:57:11.438 PDT
2024-09-27 16:57:11,437 - asyncio - ERROR - Task was destroyed but it is pending!
2024-09-27 09:57:11.438 PDT
Task was destroyed but it is pending! task: <Task pending name='Task-853' coro=<TTSSegmentsForwarder._main_task() running at /home/appuser/.local/lib/python3.11/site-packages/livekit/agents/utils/log.py:16> wait_for=<Future pending cb=[Task.task_wakeup()]>>
2024-09-27 09:57:11.438 PDT
2024-09-27 16:57:11,438 - asyncio - ERROR - Task was destroyed but it is pending!
2024-09-27 09:57:11.438 PDT
Task was destroyed but it is pending! task: <Task pending name='Task-855' coro=<TTSSegmentsForwarder._main_task.<locals>._forward_task() running at /home/appuser/.local/lib/python3.11/site-packages/livekit/agents/utils/log.py:16> wait_for=<Future pending cb=[Task.task_wakeup()]>>
2024-09-27 09:58:24.091 PDT
2024-09-27 16:58:24,092 - asyncio - ERROR - Task was destroyed but it is pending!
2024-09-27 09:58:24.091 PDT
Can you confirm preemptive_synthesis=False solves above issue, and will it impact anything in terms of performance or functionality?
that fixed it for me and I did not notice a meaningful increase in latency or any other issues
same
Same issue
Issue still exists.
I have this issue with multimodal agent livekit-agents==0.12.15
Still having that issue: Task was destroyed but it is pending!
{"message": "Task was destroyed but it is pending!\ntask: <Task pending name='Task-135' coro=<_SegmentSynchronizerImpl._main_task() done, defined at /home/appuser/.local/lib/python3.11/site-packages/livekit/agents/utils/log.py:13> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[_SegmentSynchronizerImpl.__init__.<locals>.<lambda>() at /home/appuser/.local/lib/python3.11/site-packages/livekit/agents/voice/transcription/synchronizer.py:154]>", "level": "ERROR", "name": "asyncio", "room": "voice_assistant_room_7053", "user_id": "visitor_id", "pid": 25, "job_id": "AJ_GXpxYh5n25Ec", "timestamp": "2025-05-11T06:24:32.629090+00:00"}
versions:
livekit==1.0.6
livekit-agents==1.0.20
livekit-api==1.0.2
livekit-plugins-cartesia==1.0.20
livekit-plugins-noise-cancellation==0.2.1
livekit-plugins-deepgram==1.0.20
livekit-plugins-google==1.0.20
livekit-plugins-openai==1.0.20
livekit-plugins-silero==1.0.20
livekit-plugins-turn-detector==1.0.20
livekit-protocol==1.0.2
@edengby how could we reproduce this? could you share the agent configuration as well as what your agent is doing that could cause this?