Skip to content

fix(vscode): disable voice input in remote windows - #14221

Merged
marius-kilocode merged 1 commit into
mainfrom
disable-feature-in-ssh-environments
Sep 17, 2026
Merged

marius-kilocode merged 1 commit into
mainfrom
disable-feature-in-ssh-environments

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Voice input fails in remote VS Code windows (Remote-SSH, WSL, dev containers, tunnels). The reporter connected VS Code on Windows to a remote server, started voice input, and got Could not start microphone recording. Kilo was trying to open a microphone on the remote machine, not on the user's machine.

Closes #14197

Why This Change Was Made

Recording runs in the extension host. capture.ts spawns osascript/AVFoundation, FFmpeg, or pw-record in that host, and in a remote window the host is the remote machine, which normally has no capture device. Microphone selection cannot fix this, because enumeration only sees devices on the remote machine and the user's microphone is on the local client.

The real fix is capturing in the webview with getUserMedia and MediaRecorder, so the browser process on the local client owns the microphone. That is a larger change. This PR is the stopgap: detect the window kind and turn the feature off instead of letting every remote user hit a broken recording attempt.

User Impact

  • In a remote window the microphone button no longer appears in the prompt input, the speech shortcut is inert, prewarming is skipped, and the Agent Manager new worktree dialog and diff viewer review annotations show no microphone.
  • Settings > Models > Speech to Text explains that voice input needs a local window.
  • Local windows keep the current behavior, including non-default microphone setups through KILO_FFMPEG_AUDIO_DEVICE.

Evidence

  • New speechToText capability computed from vscode.env.remoteName in src/features.ts, passed into canUseSpeechToText at every webview gate.
  • bun run compile (host typecheck, webview typecheck, lint, bundle) passes.
  • Full extension unit suite: 6026 pass, 0 fail.
  • Isolated VS Code self-test in a local window: microphone button present, Speech to Text row shows the normal Gateway description, no webview console errors.
  • Limitation: the remote branch cannot be exercised locally, because the isolated harness always starts a local window. It is covered by unit tests only (configFeatures({}, false, true), canUseSpeechToText(..., false), and the prewarm effect gate).

Follow-Up

Move capture into the webview with getUserMedia + MediaRecorder, then re-enable voice input in remote windows.

Microphone capture runs in the extension host, and for Remote-SSH, WSL,
dev containers, and tunnels that host is the remote machine. Such a machine
normally has no capture device, so starting a recording failed with
"Could not start microphone recording".

Detect the window kind from vscode.env.remoteName and report a speechToText
capability to the webview. When it is false, hide the microphone button,
skip prewarming, and disable the speech shortcut in the prompt input, the
Agent Manager new worktree dialog, and the diff viewer review annotations.
The Speech to Text settings row explains that a local window is needed.

Fixes #14197
@kilo-code-bot

kilo-code-bot Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (36 files)
  • .changeset/remote-speech-to-text.md
  • packages/kilo-docs/pages/code-with-ai/features/speech-to-text.md
  • packages/kilo-vscode/src/features.ts
  • packages/kilo-vscode/tests/unit/indexing-utils.test.ts
  • packages/kilo-vscode/tests/unit/speech-to-text-availability.test.ts
  • packages/kilo-vscode/tests/unit/speech-to-text-prewarm.test.ts
  • packages/kilo-vscode/webview-ui/agent-manager/NewWorktreeDialog.tsx
  • packages/kilo-vscode/webview-ui/diff-viewer/review-setup.ts
  • packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx
  • packages/kilo-vscode/webview-ui/src/components/settings/ModelsTab.tsx
  • packages/kilo-vscode/webview-ui/src/components/speech-to-text/SpeechToTextPrewarm.tsx
  • packages/kilo-vscode/webview-ui/src/components/speech-to-text/availability.ts
  • packages/kilo-vscode/webview-ui/src/context/config.tsx
  • packages/kilo-vscode/webview-ui/src/i18n/{ar,br,bs,da,de,en,es,fa,fr,it,ja,ko,nl,no,pl,ru,th,tr,uk,zh,zht}.ts
  • packages/kilo-vscode/webview-ui/src/stories/StoryProviders.tsx
  • packages/kilo-vscode/webview-ui/src/types/messages/config.ts

All four webview speech entry points (prompt input, Agent Manager new worktree dialog, diff/review annotations, prewarm) consume the new features().speechToText flag, and every host path that emits configLoaded/configUpdated includes it. features.ts derives the capability from vscode.env.remoteName in the extension host and all existing configFeatures callers still pass backgroundSubagents positionally, so the new third parameter is safe. Storybook defaults keep existing snapshots showing the microphone. No correctness, security, or resource-lifetime issues found in the changed lines.


Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0

Review guidance: REVIEW.md from base branch main

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.

(ssh remote ) Could not start microphone recording

2 participants