mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2026-10-03 17:54:12 +00:00
* fix(gather): clear a finalized deepgram interim word so UtteranceEnd is not deferred forever The #1088 check defers UtteranceEnd while an interim word newer than last_word_end is pending. The marker was only cleared by a non-empty is_final, so an interim word that Deepgram later dropped (e.g. line noise, followed by an empty final) left it set: the gather waited for the caller to speak again and merged both utterances. Clear the marker on any Deepgram is_final result whose window (start + duration) covers it. A word that Deepgram carries into the next segment still defers UtteranceEnd. Port of jambonz/feature-server#223. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(gather): return the buffer when a deferred deepgram UtteranceEnd is satisfied Clearing the unprocessed-word marker only helps if the covering final arrives before UtteranceEnd. If it arrives after, UtteranceEnd has already been deferred and Deepgram sends no further UtteranceEnd until new speech, so the next utterance is still merged in. Remember a deferred UtteranceEnd, and when a later final clears the marker, return the buffered transcript once that final has been handled (setImmediate, since _onTranscription has early returns). Port of jambonz/feature-server#225. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(gather): only an empty final ends a gather early after a deferred UtteranceEnd A final with words means the caller resumed talking after the pause; Deepgram will send a new UtteranceEnd after those words, so keep the existing flow instead of cutting the caller off mid-sentence (or skipping the asrTimeout wait). Only a final that drops the pending word (empty) leaves nothing else to end the gather. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>