Skip to content

Commit edeacf2

Browse files
localai-botmudlerclaude
authored
fix(realtime): keep transcription model on a language-only session.update (#10295)
A transcription session.update that carries only a language (no model) — e.g. a client forcing the STT input language — has an empty Transcription.Model. updateSession unconditionally copied that into session.ModelConfig.Pipeline.Transcription, blanking the pipeline's configured transcription backend. The next utterance then transcribed against an empty model and the backend RPC failed with "unimplemented" (surfaced to the client as transcription_failed), so transcription silently stopped whenever a language was selected. Only adopt the incoming transcription model when it is non-empty, and preserve the existing model otherwise (mirroring updateTransSession). Signed-off-by: mudler <mudler@localai.io> Co-authored-by: Ettore Di Giacinto <mudler@localai.io> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 51f4f67 commit edeacf2

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

core/http/endpoints/openai/realtime.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -990,8 +990,18 @@ func updateSession(session *Session, update *types.SessionUnion, cl *config.Mode
990990
}
991991

992992
if rt.Audio != nil && rt.Audio.Input != nil && rt.Audio.Input.Transcription != nil {
993-
session.InputAudioTranscription = rt.Audio.Input.Transcription
994-
session.ModelConfig.Pipeline.Transcription = rt.Audio.Input.Transcription.Model
993+
trUpd := rt.Audio.Input.Transcription
994+
// A language-only update (e.g. a client forcing the STT language) carries
995+
// an empty Model. Preserve the pipeline's configured transcription backend
996+
// instead of blanking it — otherwise the next utterance transcribes against
997+
// an empty model and the backend RPC fails with "unimplemented".
998+
if trUpd.Model == "" && session.InputAudioTranscription != nil {
999+
trUpd.Model = session.InputAudioTranscription.Model
1000+
}
1001+
session.InputAudioTranscription = trUpd
1002+
if trUpd.Model != "" {
1003+
session.ModelConfig.Pipeline.Transcription = trUpd.Model
1004+
}
9951005
}
9961006

9971007
if rt.Model != "" || (rt.Audio != nil && rt.Audio.Output != nil && rt.Audio.Output.Voice != "") || (rt.Audio != nil && rt.Audio.Input != nil && rt.Audio.Input.Transcription != nil) {

0 commit comments

Comments
 (0)