fix(voice): capture stderr and report recording errors to user#638
Open
MrRealORG wants to merge 2 commits into
Open
fix(voice): capture stderr and report recording errors to user#638MrRealORG wants to merge 2 commits into
MrRealORG wants to merge 2 commits into
Conversation
added 2 commits
June 14, 2026 19:57
… guard When pasting text containing '@' or '$' characters, the onContentChange handler would trigger autocomplete.onInput() for each intermediate text state, causing a flood of sdk.client.find.files() API requests. Add an isPasting guard flag that: - Is set before paste text insertion begins - Suppresses autocomplete.onInput() in onContentChange during paste - Is cleared after paste completes with a single final onInput() call Fixes XiaomiMiMo#579
When the audio recorder (sox/arecord) starts but fails at runtime (e.g. 'no default audio device configured'), the error was silently swallowed because stderr was set to 'ignore'. Users saw the voice button activate but nothing happened. Changes: - Change stderr from 'ignore' to 'pipe' in Process.spawn - Capture stderr output in a background reader - After stdout ends, check if process exited with error and has stderr - Call onError callback with the actual error message - Update UI onError handler to include the error detail in toast Partially fixes XiaomiMiMo#614
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.
Summary
Partially fixes #614 — When the audio recorder (sox/arecord) is installed but fails at runtime (e.g. `no default audio device configured`), the voice input feature silently did nothing. The recording process stderr was set to `"ignore"`, so the error was swallowed.
Root Cause
`Voice.startStreaming()` spawns the recorder process with `stderr: "ignore"`. When sox starts but immediately exits with an error (no audio device), stdout closes without data, and the user sees the voice button activate but nothing happens — no error message is shown.
Changes
`packages/opencode/src/cli/cmd/tui/util/voice.ts`:
`packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx`: