Fix duplicate transcript lines for local Whisper STT - #226
Open
surgaev wants to merge 1 commit into
Open
Conversation
For the whisper provider branch of handleMyMessage/handleTheirMessage,
every transcription was sent to the renderer twice: once immediately
via sendToRenderer('stt-update', ...), and again ~2s later when
debounceMyCompletion/debounceTheirCompletion's timer fires and calls
flushMyCompletion/flushTheirCompletion (which also sends 'stt-update').
Since the debounce path already renders the final text, the immediate
send is redundant and causes every Whisper transcription to appear
twice in the Listen UI. Removing it leaves the debounce path as the
single source of truth for the whisper provider, matching the pattern
already used for the other STT providers in this file.
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.
What
For the
whisperprovider branch ofhandleMyMessage/handleTheirMessageinsttService.js, every transcription was being sent to the renderer twice: once immediately viasendToRenderer('stt-update', ...), and again ~2 seconds later when the debounce timer (debounceMyCompletion/debounceTheirCompletion) fires and callsflushMyCompletion/flushTheirCompletion, which also sends'stt-update'.Every line spoken while using local Whisper STT shows up twice in the Listen panel.
Why
The immediate
sendToRenderercall duplicates what the debounce/flush path already does. Other STT providers in this file (Gemini, Deepgram) don't have this extra immediate send — only the whisper branch does.Fix
Removed the redundant immediate
sendToRenderercalls in both theMeandThemwhisper handlers, leaving the debounce path as the single source of truth — consistent with how the other providers already behave in this file.Testing
Verified locally with the Whisper (local) STT provider active: each spoken utterance now appears exactly once in the Listen transcript instead of twice.