feat(local-inference): stream TRANSCRIPTION partials through the chat pipe (#9105) - #9512
Conversation
… pipe (#9105) Route the local TRANSCRIPTION model handler onto the same onTextChunk -> onStreamChunk -> SSE -> frontend pipe as chat text. When the runtime wires a chunk sink (useModel injects onStreamChunk into local model params inside a streaming reply turn), the handler drives the fused streaming-ASR session and forwards each running partial transcript as a delta. - engine-bridge transcribePcm: new onPartial param; drives createStreamingTranscriber (feed in ~1s windows, subscribe to partial/final events, emit deltas). Degrades gracefully: when the fused build's streaming-ASR decoder is a stub (asr_stream_supported()==0), createStreamingTranscriber resolves the fused BATCH adapter and the final transcript is emitted once (still through the pipe). - engine.transcribePcm + the TRANSCRIPTION handler thread onPartial through. Validated on Windows CPU: Kokoro TTS -> WAV -> fused ASR transcribes accurately ("The quick brown fox ... Eliza is transcribing this sentence."), delivered via onStreamChunk. Token-by-token partials light up automatically once the native streaming-ASR decoder lands (symmetric with the ABI-v13 describe_image_stream). Part of "every model - including vision + transcription - through one streaming pipe" (#9105). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
40dc59e ('stream TRANSCRIPTION partials through the chat pipe' #9512) changed the engine call from transcribePcm(audio, signal) to transcribePcm(audio, signal, onPartial) — a 3rd streaming-callback arg — but did not update the 'arms the active voice bundle before TRANSCRIPTION' test, which still asserted toHaveBeenCalledWith(pcm, undefined). With no stream sink wired in that test, onPartial is undefined, so the real call is (pcm, undefined, undefined) and the 2-arg matcher failed deterministically (1/2122). Assert the 3rd undefined arg. No source change; the streaming signature is correct. Verified: ensure-local-inference-handler.test.ts green; plugin-local-inference 1 failed -> 0 (2110 passing). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
Routes the local TRANSCRIPTION model handler onto the same streaming pipe as chat text (
onTextChunk → onStreamChunk → SSE → frontend). WhenuseModelinjectsonStreamChunkinto the model params (inside a streaming reply turn), the handler drives the fused streaming-ASR session and forwards each running partial transcript as a delta.Changes
engine-bridge.transcribePcm: newonPartialparam → drivescreateStreamingTranscriber(feed in ~1s windows, subscribe to partial/final events, emit deltas).engine.transcribePcm+ theTRANSCRIPTIONhandler threadonPartialthrough (handler readsonStreamChunkstructurally).Graceful degradation
The current fused build's streaming-ASR decoder is a stub (
asr_stream_supported()==0), socreateStreamingTranscriberresolves the fused batch adapter and the final transcript is emitted once — still through the pipe. Token-by-token partials light up automatically when the native streaming-ASR decoder lands (symmetric with the ABI-v13describe_image_streamfor vision).Validation (Windows CPU)
Kokoro TTS → WAV → fused ASR transcribes accurately: "The quick brown fox jumps over the lazy dog. Eliza is transcribing this sentence." — delivered through
onStreamChunk.Part of "every model — including vision + transcription — through one streaming pipe" (#9105). Core
TranscriptionParams.onStreamChunklanded in #9289.🤖 Generated with Claude Code