Collapse ., / ,, punctuation artifacts in dictation transcript cleanup - #327828
Merged
Conversation
Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix chat text not being cleaned properly
Collapse Jul 28, 2026
., / ,, punctuation artifacts in dictation transcript cleanup
meganrogge
approved these changes
Jul 28, 2026
meganrogge
approved these changes
Jul 28, 2026
meganrogge
marked this pull request as ready for review
July 28, 2026 19:25
meganrogge
enabled auto-merge (squash)
July 28, 2026 19:25
auto-merge was automatically disabled
July 28, 2026 19:25
Pull request was closed
meganrogge
enabled auto-merge (squash)
July 28, 2026 19:25
meganrogge
approved these changes
Jul 28, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Normalizes punctuation artifacts created when cleaned dictation prefixes are joined with raw transcript tails.
Changes:
- Collapses redundant comma/semicolon punctuation runs.
- Adds unit coverage for reported transcript artifacts.
Show a summary per file
| File | Description |
|---|---|
chatSpeechToTextService.ts |
Adds punctuation normalization to dictation cleanup. |
chatSpeechToTextService.test.ts |
Tests representative punctuation artifacts. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Medium
pwang347
previously approved these changes
Jul 28, 2026
roblourens
previously approved these changes
Jul 28, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5ecd2473-63cb-46ba-a12b-111c90dd5fcf
Contributor
Screenshot ChangesBase: Changed (6) |
dmitrivMS
approved these changes
Jul 29, 2026
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.
Description
Dictated text landed in the chat input with artifacts like
things., firstandany,, meaningful, even though the LLM cleanup requests themselves returned well-formatted text.Root cause: incremental cleanup produces a formatted cleaned prefix that is then concatenated with the still-raw transcript tail. When the prefix ended in a sentence terminator and the tail began with a separator (
things.+, first), or raw commas doubled up,stripDictationFillers— the final normalization applied to both the live display and the returned transcript — collapsed spaces before punctuation but never collapsed the adjacent-punctuation runs themselves. So the artifacts survived into the final input.Changes:
stripDictationFillers— collapse redundant punctuation runs, keeping the stronger sentence terminator and dropping redundant separators. Only runs involving a,/;separator are touched, so...ellipses and?!are preserved.Since this is the single final pass for the final transcript, the live display, and the raw fallback when LLM cleanup is skipped or fails faithfulness, the fix applies uniformly.
Exported
stripDictationFillersand added a unit test covering the reported cases.Scope note: the earlier hypothesis of racing async writers is already guarded by
beginFinalize()+_resetIncrementalCleanup(); the artifacts originated from concatenation/normalization, so the change is kept to the cleanup pass rather than reworking writer coordination.