Repository navigation
Conversation
withoutTurnsAlreadyEnding peeled a history entry on a bare hasSuffix, so a dictated "he" vanished whenever the field ended in "the" (or "cat" in "concat"): the match followed a letter, where no paste can sit. A paste only opens the field, follows whitespace, or abuts an opener, so the peel now requires one of the three, with InsertionSeparator.endsInOpener gone public to answer the opener question from BlurtAssemblyAI. Closes AssemblyAI#454
This branch has not been deployed
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 & why
Fixes #454.
STTPrompt.withoutTurnsAlreadyEndingdecided a history entry is already carried by the prior chunk with a barehasSuffix— no check of what precedes the match. A dictated"he"was peeled from the history whenever the field in front of the caret ended in"the"(or"cat"in"concat","a"in"data"— spelling letters into a field is a real dictation shape): the match follows a letter, where no paste can ever sit. The dedupe meant to stop one utterance reaching the model twice was instead dropping utterances that were never pasted there, silently degrading the continuitystt_promptexists to carry.A paste can only sit in three positions — the start of the field, after whitespace (the separator the paste itself carried, or the field's own), or abutting an opener the separator defers to. The peel now requires one of the three:
InsertionSeparator.endsInOpeneris public (it is exactly the opener question, already answered in one place) andwithoutTurnsAlreadyEndingconsults it for the abutment case.How it was tested
The logic is pure text work, so it was extracted verbatim into a standalone harness and exercised on Linux Swift 6.2.4 before committing: every genuine dedupe still collapses (pasted runs, field-opening paste, whitespace-separated paste, opener-abutting paste, straight-quote word-start openers, interrupted runs), and every word-boundary coincidence is now kept (
he/the,cat/concat,a/data,end/append,art/start). Three regression tests added toSTTPromptTestspin the contract: a history entry inside a longer word is still sent, a paste abutting an opener still collapses, a paste that opened the field still collapses.On this Linux host (no macOS toolchain):
scripts/check.sh --portablepasses end to end, andswift-format lint --strictis clean on all three touched files. CI on macos-26 is the authority on the Swift build and test run.scripts/check.shpasses (or CI will, if I'm not on a Mac)