Skip to content

Collapse ., / ,, punctuation artifacts in dictation transcript cleanup - #327828

Merged
meganrogge merged 10 commits into
mainfrom
copilot/fix-chat-text-cleanup
Jul 29, 2026
Merged

Collapse ., / ,, punctuation artifacts in dictation transcript cleanup#327828
meganrogge merged 10 commits into
mainfrom
copilot/fix-chat-text-cleanup

Conversation

Copilot AI commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Description

Dictated text landed in the chat input with artifacts like things., first and any,, 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.

    .replace(/[,;]+[ \t]*([.!?])/g, '$1')   // ", ." / ",." -> "."
    .replace(/([.!?])[ \t]*[,;]+/g, '$1')   // ".,"        -> "."
    .replace(/([,;])[ \t]*[,;]+/g, '$1')    // ",,"        -> ","

    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 stripDictationFillers and 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.

Copilot AI requested review from Copilot and removed request for Copilot July 28, 2026 14:54
Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot July 28, 2026 15:05
Copilot AI changed the title [WIP] Fix chat text not being cleaned properly Collapse ., / ,, punctuation artifacts in dictation transcript cleanup Jul 28, 2026
Copilot AI requested a review from meganrogge July 28, 2026 15:07
@meganrogge meganrogge added this to the 1.132.0 milestone Jul 28, 2026
Copilot AI review requested due to automatic review settings July 28, 2026 19:24
@meganrogge
meganrogge marked this pull request as ready for review July 28, 2026 19:25
@meganrogge
meganrogge enabled auto-merge (squash) July 28, 2026 19:25
@meganrogge meganrogge closed this Jul 28, 2026
auto-merge was automatically disabled July 28, 2026 19:25

Pull request was closed

@meganrogge meganrogge reopened this Jul 28, 2026
@meganrogge
meganrogge enabled auto-merge (squash) July 28, 2026 19:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
pwang347 previously approved these changes Jul 28, 2026
roblourens
roblourens previously approved these changes Jul 28, 2026
@meganrogge
meganrogge dismissed stale reviews from roblourens and pwang347 via c032cd2 July 29, 2026 01:01
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 5ecd2473-63cb-46ba-a12b-111c90dd5fcf
@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: b7c14909 Current: 8b7f3131

Changed (6)

agentsVoice/voiceModeOnboarding/Voice Mode onboarding (panel)/Dark
Before After
before after
agentsVoice/voiceModeOnboarding/Voice Mode onboarding (panel)/Light
Before After
before after
agentsVoice/voiceModeOnboarding/Voice Mode onboarding (wide)/Dark
Before After
before after
agentsVoice/voiceModeOnboarding/Voice Mode onboarding (wide)/Light
Before After
before after
agentsVoice/voiceModeOnboarding/Voice Mode onboarding (narrow)/Dark
Before After
before after
agentsVoice/voiceModeOnboarding/Voice Mode onboarding (narrow)/Light
Before After
before after

@meganrogge
meganrogge merged commit 8925820 into main Jul 29, 2026
29 checks passed
@meganrogge
meganrogge deleted the copilot/fix-chat-text-cleanup branch July 29, 2026 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants