Repository navigation
Conversation
…onal wave/keybind/toast work Upstream 14075bf adds trimSilence option to startRecording; kept local showRecordingToast() persistent-toast behavior at the call site while taking upstream opts?.trimSilence passthrough.
… TTS/STT/vi/personal work Conflict in lib/stt.js resolved keeping both sides: upstream trimSilence opt-out wiring (param + opts passthrough + README) with local 0.05s noise-gate threshold; local renderer passthrough and showRecordingToast() kept.
The zen/go gateway rejects requests without the x-opencode-session header (401/400 MissingSessionID). Resolve the live session ID from api.route.current at call time and send it; per-call config.sessionID can override. Add regression tests for header present/absent.
…zation Conversation mode (/voice-conversation, <leader>v): record, auto-submit, wait reply, speak, repeat. Barge-in to interrupt, stop phrases to exit. STT normalization now receives last 8 turns / 3000 chars as <knowledge> so names and pronouns resolve from conversation.
- Palette grouping: category opencode-voice on all 12 commands (like opencode-quota). - Conversation option B: one key (send / pause speech / resume / exit), new paused state, empty turns pause instead of re-recording, tts-stop pauses the loop. - Recording toast shows leader+v hint in conversation mode, tofu-safe icon. - Lenient stop-phrase vocab (stuttered/padded commands stop, real sentences submit). - Latency: per-stage timing logs, normalize token caps (1024/2048), context prefetch during recording, conditional context attach, 15s normalize timeout with raw fallback.
…plies - Root cause of the vi/en voice inversion: detectLang flipped the whole reply to vi on ANY diacritic character present, so one stray Vietnamese word in an English reply (or a Vietnamese reply with normalized-away diacritics) misrouted the entire utterance. Replaced with a majority-vote-over-words heuristic (>=15% of words carry diacritics), exported + tested. - Tried per-word mixed-language segmentation (splicing separate WAV clips per run) first; reverted - splicing sounds jarring (clicks/gaps on every language switch). Kept the fast single-process raw-streaming speak() path, one voice decided per call. - Conversation mode: assistant reply text now streams from message.part.delta while waiting, spoken sentence-by-sentence through a serial speak() queue (local markdown cleanup, no LLM) so the answer starts before the agent turn finishes. Falls back to the full LLM-narrated speak when nothing streamable arrives (e.g. tool-only turns). tts-stop mid-stream exits the mode instead of leaving a half-heard reply.
- Normalize now returns what the user meant: fixes acoustically-close mishearings (they face -> database, bait -> page) when similar-sounding + context/domain-supported + clearly more sensible, instead of transcribing exactly. - New WORKFLOW VOCABULARY glossary (Notion page/database, master, commit) next to coding homophones. - Guardrails kept: length within ~30%, no new facts/answers, blow-up detector, raw fallback, 15s timeout. - sttNormalizeMode strict restores old behavior; custom sttPrompt file still wins.
…essing - New: /voice-notes-start|stop|cancel|status - mic stays on, background lane transcribes+normalizes, ordered Markdown + raw JSONL sidecar - lib/audio-chunker.js: silence-aware chunking with forced 20s cut + overlap carry - lib/audio-enhance.js: per-chunk voice-only preprocessing (adaptive gain to target RMS + highpass, limiter on); stats in JSONL - lib/whisper-server.js: persistent whisper-server with whisper-cli fallback - Hallucination filter: VI YouTube-outro patterns, cap 60->140 chars, 3x repetition gate; skipped chunks stay out of Markdown - Chunker learns room noise floor (notesCalibrationMs) or explicit notesSilenceRms - Mutual exclusion: live-notes vs one-shot STT vs conversation vs auto-TTS
- New sttMode streaming (batch stays default): SoX rolling capture + persistent warm whisper-server, ~1s snapshots, overlap-join transcript stability, dictated-range editor adapter - Preview toasts while speaking, single insert on finalize; submit only via captured field, never primary-chat fallthrough - Warm server lease retained across dictations; shared rendezvous with live-notes; mutual exclusion with batch/live-notes/conversation - Hardened whisper-server lifecycle (/health readiness, foreign-port refusal, owned-pid-only stop, AbortSignal) - Benchmarks on M3 Pro: ~1.9s first text cold, ~1.7s partial cadence warm, ~0.8s stop-to-final - Tests 173/173, check clean
- whisper-server claims first free port from 8090 upward when default; explicit ports stay strict; bind-race advances, exhaustion explicit - Streaming ticks default to plain json (~0.9s vs ~1.7s); verbose_json opt-in only - Sticky streaming status toast (loading/listening/finalizing with elapsed timer), cleared on all exits - Tests 188/188, check clean
This was referenced Sep 24, 2026
- Route normalize and correction through the session's running model with console-stored provider keys (auth.json) when no env key exists - Cache normalize/correction results (bounded LRU, model+prompt keyed) - Shared recorder: one auto-submit owner read live at delivery, Fix toggles the same capture, red Stop states for Speak/Fix/Reply - Read and replace the composer through nested editBuffer/setRange APIs - Gipformer STT engine option with venv detection and Text-line parsing - USB auto-forward, verified SSH login, zero-PCM vs silence diagnostics - 15s LLM timeout raised to 45s, maxTokens 2048, stale timeout timer fixed
- Reformat the files oxfmt flagged so npm run check reaches typecheck - Drop stale kv/systemPrompt args from runCorrectionMerge call - Type finalizeStreamingDictation opts so submit is a boolean or live reader
Selecting whisper in /stt-engine now opens the model picker in one flow, so small CPU-friendly variants are choosable without a second command. Shares one showModelPicker for local + API branches. Also documents the 2026-11-04 chunked-transcription failure (all spans fail -> firstError surfaces, record discarded) in docs/bugs.
A remote sttCaptureCmd runs ssh, whose exit 255 means connection failure, not a SoX format error. Label the command truthfully, keep the stderr tail (was discarded), and hint at adb forward/sshd for 255.
- Hallucination filter no longer drops dictation containing "you" - Batch auto-end transcribes instead of silently discarding - Cancel releases processing/toast; stale pipelines never clobber flags - Conversation short/stale turns release processing; paused actions render - Streaming: no double start, no auto-end while paused/loading, mic frozen when paused during model load, paused state survives startup - Cancel during streaming finalize cancels the stream - Async streaming start falls back to batch when refused - Fix self-heals when the mic fails to start - TTS: preempted utterance never clears the next status line, all-failed synthesis clears loading, remote hard pause no longer ends playback - API model picker key and command palette strings
… edges - Cross-process start lock: one instance spawns VieNeu, others wait and adopt (no duplicate 1.3 GB sidecars, no false start failures from port races) - After a VieNeu failure, retry in the background and read with Piper now - Done finishes a paused live dictation instead of resuming it - Opening the mic pauses or stops a reply that is preparing or between parts - sttPrompt is the LLM prompt only; whisper no longer receives it - Auto-submit without a focused field no longer blocks on the agent turn - Destroyed composer mid-dictation falls back instead of dropping text - Replay keeps parts heard before a stop; auto-read retries a late reply - README: OpenCode v2 loads plugins from cli.json, not tui.jsonc
- Player: setRate/seek; sox tempo -s locally, ffmpeg atempo on the phone, respawn at the current position, stale-process tokens kept - TTS machine: clips played from a playlist so rewind crosses into the previous part; speed saved in tts.rate and applied to every clip - Status line: [«5] [⏸] [5»] [1.25x] while reading, [1x] when idle - Commands: /tts-rewind (<leader>-), /tts-forward (<leader>=), /tts-faster, /tts-slower, /tts-rate
- /stt-engine lists Local whisper (with current model) and API; an unconfigured API is shown with what to add instead of a silent toast - Choosing Local whisper opens the model picker right after - Status line shows the engine ([turbo], [API]); clicking it opens the picker
- src/node: daemon on the engine host (whisper, VieNeu, Piper) that owns the microphones and speakers of every device: this Mac, Linux boxes over ssh (PipeWire/Pulse), and an Android phone with Termux (USB or Tailscale) - Follow me: audio goes to the device with the latest keyboard/mouse/touch activity (phone only while Termux is on screen); devices without a working mic/speaker are skipped; pin with /voice-device or the status button - One dictation at a time across machines; one shared speaker; VieNeu requests queued per client voice - Plugin finds the node (voiceNode auto: local, then tailnet) or starts and restarts it (voiceNode host); falls back to local engines without a node - Security: loopback + Tailscale IP only, same-owner peers (tailscale whois) - Real-device fixes: pw-cat/pacat need explicit mode and --raw flags under exec -a; graceful remote stop keeps the buffered tail; phone recorder and temp files cleaned up on stop, kill and dropped connections; pure-zero audio reported as a blocked mic; silence judged against each mic's noise floor so auto-finish works on noisy remote mics
- [⏹ Auto-stop ✓/✗] toggles finishing dictation after 2.5 s of silence, which before was only reachable with /stt-auto-end - rename [⏎ Auto] to [⏎ Auto-send] so the two toggles are distinguishable - fix: toggling auto-submit/auto-finish from the command palette did not redraw the status line
The TTS session rewinds across parts by seeking past the end of the current clip (seek(Infinity)). JSON encodes Infinity as null, so the node ignored the seek: the clip kept playing and earlier parts could not be heard again. Send a finite past-the-end position instead.
…exact seconds - position/duration cover the whole reply instead of the current part; '+' after the duration while later parts are still synthesizing - the part number (e.g. 2/4) leaves the status line; it stays in the debug log (part start, seek from/to with offsets) and in /voice-status - «5 / 5» move on the whole-reply timeline in both directions, landing at the exact offset in another part; seeking past the end finishes reading - fix(node): the previous clip's final state no longer overwrites the next clip's position (the clock flashed ahead at part boundaries); the node confirms each clip with a 'started' message tagged with its play id
…tons off The row had a fixed height of 1 and no wrapping, so on a phone-sized terminal the right-hand buttons (Reply, speed, Read, ...) were invisible. Wrap the row and space buttons with a column gap so wrapped lines start flush.
…en sshd is down 'Playback failed (ssh exit 255): connect to host 127.0.0.1 port 8022: Connection refused' — the adb forward to the phone's sshd disappears when the cable is replugged or the adb server restarts. Only the mic path restored it; replies played on the phone failed. - presence (every 3 s) checks 'adb forward --list' and restores the forward when missing, for mic and speaker alike - presence also reports whether sshd runs in Termux; without it the phone is not usable, so follow-me falls back to another device instead of failing - state changes are logged once (sshd down/up, forward restored/failed)
A Linux device whose ssh login fails was probed every 3 s. Each failure
counts against that box's sshd (OpenSSH PerSourcePenalties), so the node
kept the whole engine host locked out of it ('Not allowed at this time'),
including the user's own ssh sessions. Failing devices are now probed
after 3, 6, 12 ... s up to every 5 min, and probed every tick again once
they answer. The ssh error is logged (debug) and online/offline
transitions once (info).
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.
Single consolidated PR with everything built on this fork since
14075bf. Supersedes #17, #18, #19, #20 (same content plus much more — happy to close those if this is preferred).All green:
npm run checkclean,npm test188/188 pass.Features
<leader>v), stop-phrase detection, sentence-by-sentence reply streaming via TTS./voice-notes-start|stop|cancel|status) — continuous mic capture with background transcribe+normalize lanes; silence-aware chunking with forced 20s cuts + overlap dedup; ordered Markdown + raw JSONL sidecar; persistentwhisper-serverwithwhisper-clifallback.sttMode: streaming, batch stays default) — SoX rolling capture + warm persistent whisper-server, ~1s snapshots, overlap-join transcript stability, live preview toasts + single insert on finalize, zero LLM/quota. Measured on M3 Pro: ~1.9s first text cold, ~1.7s partial cadence, ~0.8s stop-to-final.sttAutoSubmit; focused-input routing (focusMode: auto).Fixes / hardening
Verification
Happy to split this into smaller PRs on request — kept as one since the pieces share the STT/TTS core.