Clear stale ASR capture on end of utterance in DuplexPipeline. Add test to verify behavior when conversation state changes, ensuring proper handling of ASR capture variables.
This commit is contained in:
@@ -1393,6 +1393,11 @@ class DuplexPipeline:
|
||||
async def _on_end_of_utterance(self) -> None:
|
||||
"""Handle end of user utterance."""
|
||||
if self.conversation.state not in (ConversationState.LISTENING, ConversationState.INTERRUPTED):
|
||||
# Prevent a stale ASR capture watchdog from repeatedly forcing EOU
|
||||
# once the conversation has already moved past user-listening states.
|
||||
self._asr_capture_active = False
|
||||
self._asr_capture_started_ms = 0.0
|
||||
self._pending_speech_audio = b""
|
||||
return
|
||||
|
||||
# Add a tiny trailing silence tail to stabilize final-token decoding.
|
||||
|
||||
Reference in New Issue
Block a user