Skip to content

Preserve manually typed text when voice mode sends in a new chat#326035

Open
meganrogge with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-voice-mode-text-dropping
Open

Preserve manually typed text when voice mode sends in a new chat#326035
meganrogge with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-voice-mode-text-dropping

Conversation

Copilot AI commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Description

In the Agents window, dictating into a new chat that already had manually typed text (plus an optional pasted image) sent a query containing only the voice-dictated portion — the typed text was dropped.

The backend voice LLM's send_to_chat tool routes the transcript through _chat.voice.acceptInputNewChatInputWidget.sendQuery(text), which called model.setValue(text), overwriting the input before _send() read it. Attachments survived (they live in _contextAttachments); the typed text did not. The backend only knows the spoken phrase, so the typed portion must be preserved client-side.

  • newChatInput.tssendQuery: append the dictated text to any existing input instead of replacing it.
const existing = model.getValue().trimEnd();
const combined = existing ? `${existing} ${text}` : text;
model.setValue(combined);
this._send();

Scoped to the composer path (the reported new-chat scenario); the existing-session widget.acceptInput flow is untouched. The _sending guard against double-submits from rapid transcripts is preserved.

Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot July 15, 2026 19:22
Copilot AI changed the title [WIP] Fix issue where manual text is dropped in voice mode Preserve manually typed text when voice mode sends in a new chat Jul 15, 2026
Copilot AI requested a review from meganrogge July 15, 2026 19:23
@meganrogge meganrogge marked this pull request as ready for review July 15, 2026 20:13
Copilot AI review requested due to automatic review settings July 15, 2026 20:13
@meganrogge meganrogge enabled auto-merge (squash) July 15, 2026 20:13

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

Preserves manually entered draft text when voice input submits a new Agents window chat.

Changes:

  • Appends dictated text to the existing draft.
  • Retains the existing send guard and attachment handling.
Show a summary per file
File Description
src/vs/sessions/contrib/chat/browser/newChatInput.ts Combines existing draft and voice text before submission.

Review details

  • Files reviewed: 1/1 changed files
  • Comments generated: 3
  • Review effort level: Medium

Comment thread src/vs/sessions/contrib/chat/browser/newChatInput.ts Outdated
Comment on lines +911 to +913
// Preserve any manually typed text. Voice dictation only knows about the
// spoken phrase, so append it to whatever the user already typed instead
// of overwriting it, otherwise the typed portion is dropped from the query.
// spoken phrase, so append it to whatever the user already typed instead
// of overwriting it, otherwise the typed portion is dropped from the query.
const existing = model.getValue().trimEnd();
const combined = existing ? `${existing} ${text}` : text;
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
roblourens
roblourens previously approved these changes Jul 15, 2026
Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
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.

Voice mode: manually typed text is dropped when turning on voice mode in a new chat

6 participants