fix: Realtime call answers twice when a short pause splits a sentence (#32773)

In a Realtime call, a short pause mid-sentence can make the Realtime provider split the sentence into two turns. If you kept talking before the first half was transcribed, Open WebUI asked the voice model for one reply per half. The voice model hears the whole conversation each time, so both replies answered the full sentence and you heard the same answer twice, the second one about 15 seconds later. Now Open WebUI asks the voice model only once, after the last half, and that one reply covers the whole sentence.

Fixes #32764
This commit is contained in:
Classic298 2026-10-20 19:17:06 +02:00 • committed by GitHub
parent 97eee77568
commit 25b1156623
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -261,8 +261,8 @@ export class RealtimeCall {
)
return;
if (command.type === 'bridge.respond' && command.item_id) {
const index = this.commands.findIndex((item) => !item.item_id);
this.commands.splice(index < 0 ? this.commands.length : index, 0, command);
// The newest reply hears every transcript, so older unsent ones are redundant.
this.commands = [command, ...this.commands.filter((item) => !item.item_id)];
} else this.commands.push(command);
this.flush();
}