Skip to content

feat(local-inference): stream TRANSCRIPTION partials through the chat pipe (#9105) - #9512

Merged
lalalune merged 1 commit into
developfrom
feat/local-transcription-streaming
Jun 24, 2026
Merged

lalalune merged 1 commit into
developfrom
feat/local-transcription-streaming

Conversation

@lalalune

Copy link
Copy Markdown
Member

Routes the local TRANSCRIPTION model handler onto the same streaming pipe as chat text (onTextChunk → onStreamChunk → SSE → frontend). When useModel injects onStreamChunk into 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: new onPartial param → drives createStreamingTranscriber (feed in ~1s windows, subscribe to partial/final events, emit deltas).
  • engine.transcribePcm + the TRANSCRIPTION handler thread onPartial through (handler reads onStreamChunk structurally).

Graceful degradation

The current fused build's streaming-ASR decoder is a stub (asr_stream_supported()==0), so createStreamingTranscriber resolves 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-v13 describe_image_stream for 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.onStreamChunk landed in #9289.

🤖 Generated with Claude Code

… 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>

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 49eb17f2-d2fe-4d53-87d9-613c68a79e30

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/local-transcription-streaming

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lalalune
lalalune merged commit 40dc59e into develop Jun 24, 2026
29 of 30 checks passed
@lalalune
lalalune deleted the feat/local-transcription-streaming branch June 24, 2026 23:25
lalalune pushed a commit that referenced this pull request Jun 25, 2026
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

claude Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Claude encountered an error —— View job


I'll analyze this and get back to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant