From e511cf90777e383cf33b17dd30467a99187a6156 Mon Sep 17 00:00:00 2001 From: Xin Wang Date: Fri, 6 Feb 2026 08:30:37 +0800 Subject: [PATCH] Fix Potential state duplication on barge-in. --- core/duplex_pipeline.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/duplex_pipeline.py b/core/duplex_pipeline.py index 396ca29..fd5c071 100644 --- a/core/duplex_pipeline.py +++ b/core/duplex_pipeline.py @@ -659,8 +659,10 @@ class DuplexPipeline: if self.llm_service and hasattr(self.llm_service, 'cancel'): self.llm_service.cancel() - # Interrupt conversation - await self.conversation.interrupt() + # 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 await self.conversation.start_user_turn()