Fix Potential state duplication on barge-in.
This commit is contained in:
@@ -659,8 +659,10 @@ class DuplexPipeline:
|
|||||||
if self.llm_service and hasattr(self.llm_service, 'cancel'):
|
if self.llm_service and hasattr(self.llm_service, 'cancel'):
|
||||||
self.llm_service.cancel()
|
self.llm_service.cancel()
|
||||||
|
|
||||||
# Interrupt conversation
|
# Interrupt conversation only if there is no active turn task.
|
||||||
await self.conversation.interrupt()
|
# 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
|
# Reset for new user turn
|
||||||
await self.conversation.start_user_turn()
|
await self.conversation.start_user_turn()
|
||||||
|
|||||||
Reference in New Issue
Block a user