Fix _stop_current_speech doesn’t cancel LLM/TTS services.

This commit is contained in:
Xin Wang
2026-02-06 08:05:33 +08:00
parent 31d24a7428
commit 605968a639

View File

@@ -669,6 +669,12 @@ class DuplexPipeline:
await self._current_turn_task
except asyncio.CancelledError:
pass
# Ensure underlying services are cancelled to avoid leaking work/audio
if self.tts_service:
await self.tts_service.cancel()
if self.llm_service and hasattr(self.llm_service, 'cancel'):
self.llm_service.cancel()
self._is_bot_speaking = False
self._interrupt_event.clear()