Fix Potential state duplication on barge-in.

This commit is contained in:
Xin Wang
2026-02-06 08:30:37 +08:00
parent 0576231d8d
commit e511cf9077

View File

@@ -659,7 +659,9 @@ class DuplexPipeline:
if self.llm_service and hasattr(self.llm_service, 'cancel'):
self.llm_service.cancel()
# Interrupt conversation
# Interrupt conversation only if there is no active turn task.
# When a turn task exists, it will handle end_assistant_turn() to avoid double callbacks.
if not (self._current_turn_task and not self._current_turn_task.done()):
await self.conversation.interrupt()
# Reset for new user turn