Skip to content

fix(vscode): wait for microphone capture readiness - #11738

Closed
marius-kilocode wants to merge 3 commits into
mainfrom
fix/speech-capture-readiness
Closed

fix(vscode): wait for microphone capture readiness#11738
marius-kilocode wants to merge 3 commits into
mainfrom
fix/speech-capture-readiness

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

Speech input currently appears to be recording as soon as the microphone button is clicked, even though FFmpeg and the operating system may still be opening the capture device. Speech during that gap is not recorded, which is especially noticeable on the first recording after startup.

Introduce an explicit microphone-starting state and keep the loading indicator visible until the extension confirms that audio capture is ready. The recording indicator now marks the actual point when users can begin speaking.

Prewarm only FFmpeg binary discovery for users who have Kilo speech access, without opening the microphone or prompting for permission. Signed-out users and users with Kilo disabled do not run the prewarm, and failed discovery remains retryable when recording starts.

}

const click = () => {
if (props.speech.state() === "starting") return

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.

WARNING: Starting state cannot be cancelled from the button

The new state machine and tests explicitly support cancelling a pending microphone startup, but this early return swallows the only user action while the spinner is shown. If opening the capture device hangs for a few seconds or the permission flow stalls, the user has to wait for timeout or for the recording to become ready before they can recover. Letting the second click call speech.cancel() would preserve the new readiness indicator without removing the escape hatch.

Suggested change
if (props.speech.state() === "starting") return
if (props.speech.state() === "starting") return props.speech.cancel()

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 1 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
packages/kilo-vscode/webview-ui/src/components/speech-to-text/SpeechToTextButton.tsx 26 Microphone startup cannot be cancelled from the button
Files Reviewed (32 files)
  • .changeset/warm-speech-capture.md - 0 issues
  • packages/kilo-vscode/src/services/input-tools.ts - 0 issues
  • packages/kilo-vscode/src/speech-to-text/capture.ts - 0 issues
  • packages/kilo-vscode/tests/unit/speech-to-text-prewarm.test.ts - 0 issues
  • packages/kilo-vscode/tests/unit/use-speech-to-text.test.ts - 0 issues
  • packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/diff-viewer/DiffViewerApp.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/App.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/components/speech-to-text/SpeechToTextButton.tsx - 1 issue
  • packages/kilo-vscode/webview-ui/src/components/speech-to-text/SpeechToTextPrewarm.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/components/speech-to-text/useSpeechToText.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/ar.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/br.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/bs.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/da.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/de.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/en.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/es.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/fr.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/it.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/ja.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/ko.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/nl.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/no.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/pl.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/ru.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/th.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/tr.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/uk.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/zh.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/zht.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/types/messages/webview-messages.ts - 0 issues

Fix these issues in Kilo Cloud

Previous Review Summary (commit b51b16e)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit b51b16e)

Status: 1 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
packages/kilo-vscode/webview-ui/src/components/speech-to-text/SpeechToTextButton.tsx 26 Microphone startup cannot be cancelled from the button
Files Reviewed (32 files)
  • .changeset/warm-speech-capture.md - 0 issues
  • packages/kilo-vscode/src/services/input-tools.ts - 0 issues
  • packages/kilo-vscode/src/speech-to-text/capture.ts - 0 issues
  • packages/kilo-vscode/tests/unit/speech-to-text-prewarm.test.ts - 0 issues
  • packages/kilo-vscode/tests/unit/use-speech-to-text.test.ts - 0 issues
  • packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/diff-viewer/DiffViewerApp.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/App.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/components/speech-to-text/SpeechToTextButton.tsx - 1 issue
  • packages/kilo-vscode/webview-ui/src/components/speech-to-text/SpeechToTextPrewarm.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/components/speech-to-text/useSpeechToText.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/ar.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/br.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/bs.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/da.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/de.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/en.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/es.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/fr.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/it.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/ja.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/ko.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/nl.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/no.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/pl.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/ru.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/th.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/tr.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/uk.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/zh.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/zht.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/types/messages/webview-messages.ts - 0 issues

Fix these issues in Kilo Cloud


Reviewed by gpt-5.4-20260305 · Input: 81.2K · Output: 11.9K · Cached: 437.2K

Review guidance: REVIEW.md from base branch main

Run the prewarm child from webview-ui so JSX resolves via solid-js instead of falling back to react/jsx-dev-runtime, which only resolved when react happened to be hoisted nearby and otherwise failed the spawn at ~80ms. Assert on an explicit PASS/FAIL sentinel: real prewarm-logic failures surface immediately while transient spawn failures retry.
@github-actions

Copy link
Copy Markdown
Contributor

To stay organized pull requests are automatically closed after 30 days of inactivity. If the pull request is still relevant please reopen it or create a fresh new one.

@github-actions github-actions Bot closed this Jul 30, 2026
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.

2 participants