agents icon indicating copy to clipboard operation
agents copied to clipboard

TTSSegmentsForwarder ERROR- agent stops speaking after this for 2-3 seconds. Facing this issue randomly.

Open Test-isom opened this issue 1 year ago • 12 comments

{"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"}

Test-isom avatar Sep 26 '24 08:09 Test-isom

same issue here!

lhylton avatar Sep 27 '24 16:09 lhylton

hey we're experiencing the same issue - which version are you using?

nazywamsiepawel avatar Sep 27 '24 16:09 nazywamsiepawel

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)

davidzhao avatar Sep 27 '24 19:09 davidzhao

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

nazywamsiepawel avatar Sep 27 '24 19:09 nazywamsiepawel

Can you confirm preemptive_synthesis=False solves above issue, and will it impact anything in terms of performance or functionality?

Test-isom avatar Oct 01 '24 11:10 Test-isom

that fixed it for me and I did not notice a meaningful increase in latency or any other issues

lhylton avatar Oct 01 '24 12:10 lhylton

same

jezell avatar Oct 02 '24 15:10 jezell

Same issue

aryan1107 avatar Oct 08 '24 17:10 aryan1107

Issue still exists.

SleepAt11 avatar Oct 31 '24 15:10 SleepAt11

I have this issue with multimodal agent livekit-agents==0.12.15

tbeaudouin05 avatar Mar 02 '25 16:03 tbeaudouin05

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 avatar May 11 '25 06:05 edengby

@edengby how could we reproduce this? could you share the agent configuration as well as what your agent is doing that could cause this?

davidzhao avatar May 15 '25 05:05 davidzhao