Skip to content

feat(tui): wire voice recording into TUI prompt#2

Open
ncylich wants to merge 3 commits intosjawhar:feat/voice-modefrom
cactus-compute:feat/tui-voice-recording
Open

feat(tui): wire voice recording into TUI prompt#2
ncylich wants to merge 3 commits intosjawhar:feat/voice-modefrom
cactus-compute:feat/tui-voice-recording

Conversation

@ncylich
Copy link
Copy Markdown

@ncylich ncylich commented Apr 15, 2026

Issue for this PR

Closes anomalyco#22591

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

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 voiceTranscribe RPC method is added that accepts base64-encoded audio, reconstructs the File/FormData on the worker side, and calls the server's /voice/transcribe endpoint directly.

Recording uses ffmpeg with avfoundation on macOS and pulse/alsa on Linux, falling back to sox/rec/arecord. A /record slash 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 dev using 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

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

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.
@ncylich ncylich force-pushed the feat/tui-voice-recording branch from ec732a0 to b0adc02 Compare April 15, 2026 06:42
@github-actions
Copy link
Copy Markdown

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@sjawhar sjawhar force-pushed the feat/voice-mode branch 5 times, most recently from 3648e46 to ac37fd5 Compare April 16, 2026 22:50
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