fix(stt): match dictionary echo against truncated Groq prompt#1229
Open
stantheman0128 wants to merge 1 commit into
Open
fix(stt): match dictionary echo against truncated Groq prompt#1229stantheman0128 wants to merge 1 commit into
stantheman0128 wants to merge 1 commit into
Conversation
Groq truncates custom dictionary prompts to ~890 chars, but the echo filter still compared against the full dictionary, so truncated echoes could slip through as paste. Pass the prompt that was actually sent. Co-authored-by: Cursor <cursoragent@cursor.com>
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
Groq (and custom Groq endpoints) truncate the custom dictionary prompt to about 890 characters before STT. The dictionary-echo filter still compared transcripts against the full dictionary, so a truncated echo could miss the filter and paste into the focused field.
This change:
truncateDictionaryPromptnext to the echo matcherisDictionaryEchotake the prompt that was actually sentAI assistance
Assisted by Cursor / Grok. Human author: Stan Shih (stantheman0128). I reviewed the diff and verification output.
Verification / Evidence
` ext
node --test test/helpers/dictionaryEchoFilter.test.js
18 pass, 0 fail (includes truncated-prompt echo case)
npx tsc --noEmit -p src
exit 0
npm run lint
exit 0
`
Live note: truncation logic was already present for Groq; the bug was echo matching against the unsent full dictionary.
Test plan