feat(stt): streaming transcription proxy over websocket#455
Merged
Conversation
3 tasks
piorpua
pushed a commit
that referenced
this pull request
Jun 12, 2026
🤖 I have created a release *beep* *boop* --- ## [0.1.29](v0.1.28...v0.1.29) (2026-06-12) ### Features * converge team mode runtime architecture ([#464](#464)) ([abeb9a1](abeb9a1)) * **stt:** streaming transcription proxy over websocket ([#455](#455)) ([1c19a8b](1c19a8b)) ### Bug Fixes * **agent:** validate managed ACP platform binaries ([#462](#462)) ([651c79f](651c79f)) * **cron:** retry busy jobs from runtime state ([#459](#459)) ([9918058](9918058)) * isolate ACP cancel turn completion ([#461](#461)) ([ea01ee6](ea01ee6)) * **office:** probe star-office preferred_url host as given ([#456](#456)) ([3c2149c](3c2149c)) ### Code Refactoring * **assistant:** finalize unified governance storage ([#449](#449)) ([aba2d2a](aba2d2a)) ### Documentation * clarify production logging guidance ([#460](#460)) ([118ed03](118ed03)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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
Adds
GET /api/stt/stream— a short-lived WebSocket endpoint that proxies PCM16 microphone audio to the provider's native streaming API and pushes live transcripts back to the client. This is the backend half of AionUi's streaming voice input (phase 2 of the voice-input optimization; AionUi client follows in a separate PR).Wire protocol (client ↔ AionCore)
{"type":"start","format":"pcm16","sampleRate":24000,"channels":1,"languageHint":"zh"?}{"type":"stop"}{"type":"ready"}{"type":"partial","text":...}/{"type":"final","text":...}{"type":"done"}{"type":"error","code":"STT_*","msg":...}STT_STREAM_UNSUPPORTED,STT_STREAM_PROTOCOL)Architecture
aionui-shell/stt_stream.rs: transport-agnostic session state machine (mpsc channels, mock-tested) with a documented cancel-safety contract on the upstream trait./v1/listen, linear16 passthrough, interim_results) and OpenAI Realtime transcription (GA protocol:session.updatetype=transcription, base64input_audio_buffer.append, delta/completed events) —whisper-1is refused withSTT_STREAM_UNSUPPORTEDso clients fall back to the existingPOST /api/sttfile path.shell_routes, inheriting the exact same auth middleware asPOST /api/stt; config loading is shared (load_stt_config).Found by real-API smoke testing (manual runner in
examples/stt_stream_smoke.rs)fix(shell): rustls had no process-level CryptoProvider → realwss://connects panicked (mock tests usews://). Fixed with an explicit connector following the lark/dingtalk plugin pattern.fix(shell): tail loss — with server VAD producing multiple items, the adapter closed after the first final, dropping in-flight tail transcripts. Now tracks per-item state and closes only when the commit is acked and no item owes a transcript. Verified against the live OpenAI API (two-sentence clip, both finals delivered).Test plan
stt_stream_e2e: unauth 401, STT_DISABLED, full mock-Deepgram flow, protocol violation)cargo test --workspace,cargo clippy --workspace --all-targets -- -D warnings,cargo fmt --checkall greengpt-4o-mini-transcribe): live partials/finals for both sentences, clean close —STT_SMOKE_API_KEY=... cargo run -p aionui-shell --example stt_stream_smoke -- clip.wav