wooden-beard-26644
11/19/2025, 7:18 PMtall-airline-16756
11/20/2025, 12:39 PMtask.exception().
• Cancel and Await Pending Tasks: Try using await utils.aio.cancel_and_wait(task) to make sure everything shuts down cleanly and exceptions are caught.
• Wrap Coroutine Execution: Using try-except blocks can really help catch and log exceptions, especially asyncio.CancelledError.
• Correct Use of `wait_for_playout()`: Avoid calling SpeechHandle.wait_for_playout() inside a tool function. Instead, use RunContext.wait_for_playout() for better results.
• Enable Debug Logging: If you’re still running into trouble, turning on debug mode and gathering detailed logs—including your LiveKit library version, room identifier, and relevant logs—can provide helpful insights.
I hope these tips help you get past the issue! Please feel free to reach out if you want me to clarify anything or if you need more assistance. I’m here to support you! Sources: livekit-agents/livekit/agents/voice/speech_handle.py | Still Have Questions