From 45ea65b60f99f36052cec637594a6b64ef8c563d Mon Sep 17 00:00:00 2001 From: chenghao-mou Date: Fri, 8 May 2026 16:42:16 +0000 Subject: [PATCH] fix(core): clean up manual user turn state --- agents/src/voice/audio_recognition.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/agents/src/voice/audio_recognition.ts b/agents/src/voice/audio_recognition.ts index 2584432bc..83cb6d1f5 100644 --- a/agents/src/voice/audio_recognition.ts +++ b/agents/src/voice/audio_recognition.ts @@ -1404,8 +1404,18 @@ export class AudioRecognition { this.audioInterimTranscript = ''; this.audioPreflightTranscript = ''; this.finalTranscriptConfidence = []; + this.lastFinalTranscriptTime = 0; + this.speechStartTime = undefined; + this.lastSpeakingTime = undefined; + this.speaking = false; this.userTurnCommitted = false; + if (this.userTurnSpan?.isRecording()) { + this.userTurnSpan.end(); + } + this.userTurnSpan = undefined; + this.sttRequestIds = []; + const restartStt = async () => { const unlock = await this.sttLifecycleLock.lock(); try {