feat(tui): wire voice recording into TUI prompt#2
Open
ncylich wants to merge 3 commits intosjawhar:feat/voice-modefrom
Open
feat(tui): wire voice recording into TUI prompt#2ncylich wants to merge 3 commits intosjawhar:feat/voice-modefrom
ncylich wants to merge 3 commits intosjawhar:feat/voice-modefrom
Conversation
Add /record slash command and command palette entry for voice input in the TUI. Records audio via ffmpeg (macOS avfoundation, Linux pulse/alsa) or sox/arecord, sends through worker RPC as base64 to the server's /voice/transcribe endpoint. Visual feedback includes red border while recording, placeholder text, and status bar label showing recording/transcribing state.
ec732a0 to
b0adc02
Compare
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
3648e46 to
ac37fd5
Compare
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.
Issue for this PR
Closes anomalyco#22591
Type of change
What does this PR do?
The voice mode branch added STT support for the web UI but left the TUI without voice input. This wires recording into the TUI prompt.
The TUI's worker RPC serializes request bodies as text, which corrupts binary FormData uploads. To work around this, a dedicated
voiceTranscribeRPC method is added that accepts base64-encoded audio, reconstructs the File/FormData on the worker side, and calls the server's/voice/transcribeendpoint directly.Recording uses ffmpeg with avfoundation on macOS and pulse/alsa on Linux, falling back to sox/rec/arecord. A
/recordslash command starts recording; pressing Enter stops it, sends the audio for transcription, and inserts the result into the prompt.All changes are in
packages/opencode/src/cli/cmd/tui/— no web UI or server code is modified.How did you verify your code works?
Tested locally with
bun devusing a cactus server running parakeet-tdt-0.6b-v3 for STT. Verified recording, transcription, text insertion, and visual feedback (red border, status bar, placeholder text). Confirmed web UI voice features are unaffected. Typechecks pass.Checklist