fix(serve): prevent echo-trigger loops that break demo TTS#133
Merged
Conversation
Align the browser-side interaction model with mlx-live's interruption intent: avoid immediate cut-off on speechstart and confirm interruption on final recognition text with echo guards.\n\nThis fixes a regression where echo/noise could repeatedly trigger new turns, close TTS sockets before establishment, and make demo playback appear broken.\n\nAlso gate recognition auto-restart with an explicit run flag to avoid stop->onend restart races while transitioning into THINKING.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/ws/ttsbefore streaming startedonspeechstarthard interrupt with final-text-confirmed interruptionstop -> onend -> restartraces while enteringTHINKINGmlx-live Comparison
mlx-liveuses backend VAD-triggered interrupt and explicit interrupt events to stop playback, instead of immediate browser-side speechstart interruption:interrupt_active_responseinmain.py{"type":"interrupt"}by clearing playback inweb/index.htmlThis PR aligns our demo behavior with that intent by making interruption confirmation stricter and less echo-prone.
Validation
cargo test serve::tests -- --nocapturedeep-3477.js):binary=1 decoded=1 played=1barge-think-3477-v2.js):LLM_CALLS=2THINK_IN_WS_SEND=falselistening…