From 46662106fc023eab5462064a26d1215633e5b40a Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Mon, 12 Oct 2026 10:51:26 +0200 Subject: [PATCH] fix: the voice model no longer keeps hearing noise from earlier in a Realtime Voice call When noise in a Realtime Voice call was mistaken for speech and transcribed to nothing, it never showed up in the chat, but its audio stayed in the voice model's memory of the call. Every later answer then came from a conversation full of noise turns nobody had spoken. That audio is now removed from the voice model's memory as soon as its transcription comes back empty or fails. Fixes #32250 --- backend/open_webui/routers/audio/realtime.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/backend/open_webui/routers/audio/realtime.py b/backend/open_webui/routers/audio/realtime.py index 5d1c5b0320..8f0e8a8115 100644 --- a/backend/open_webui/routers/audio/realtime.py +++ b/backend/open_webui/routers/audio/realtime.py @@ -462,6 +462,17 @@ async def realtime_call(ws: WebSocket): if kind.startswith(('response.', 'conversation.item.', 'input_audio_buffer.')): async with asyncio.timeout(5): await ws.send_json(event) + if ( + kind + in { + 'conversation.item.input_audio_transcription.completed', + 'conversation.item.input_audio_transcription.failed', + } + and event['item_id'] not in protocol.transcripts + ): + # Keep noise that produced no words out of the voice model's context. + async with asyncio.timeout(5): + await upstream.send_json({'type': 'conversation.item.delete', 'item_id': event['item_id']}) raise ValueError('Voice provider connection closed') async def check_auth():