Skip to content

berd-call: abort a voice change without waiting on the provider - #410

Closed
johnmatthewtennant wants to merge 2 commits into
mainfrom
jtennant/berd-call-voice-change-abort
Closed

johnmatthewtennant wants to merge 2 commits into
mainfrom
jtennant/berd-call-voice-change-abort

Conversation

@johnmatthewtennant

@johnmatthewtennant johnmatthewtennant commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Changing the Spokesperson's voice during a realtime call could freeze the call for up to five seconds when the change was rolled back. Aborting the change waited for OpenAI to confirm that the cutover's input clear had been applied, blocking the call's control loop and the menu bar. A late confirmation could also be mistaken for a later input reset's, and an aborted cutover reported a result after the caller had already moved on.

Aborting now returns at once. The cutover's clear stays in flight, and its confirmation is matched by send order, so it can neither complete a later reset nor report a cutover result. A clear the provider never confirms still ends the session as before. Cutover commands now share the input queue with audio and resets, so input replayed after an abort always follows the cutover's clear. The unused candidate runtime shuts down in the background, and an input reset is accepted while a cutover is pending.

Related issue

None.

Testing

  • New test against a local Realtime server that delays its clear confirmations by a second: aborting a cutover returns immediately, an input reset sent right after it completes only once its own clear is confirmed, and no cutover result is reported. Before the change, the abort blocked until the call's control timeout and the session failed.
  • New test: across 20 rounds of starting a cutover, aborting it and replaying input, the provider always receives the clear before the replayed audio.

johnmatthewtennant and others added 2 commits October 20, 2026 23:00
Rolling back a Spokesperson voice change blocked the call until OpenAI
confirmed the cutover's input clear, and stalled the menu bar when that
confirmation was slow. Abandon the cutover immediately instead and
attribute its late confirmation by send order, so it can neither
complete a later reset nor report a stale cutover result. Retire the
candidate runtime in the background.

Signed-off-by: John Tennant <jtennant@block.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Now that aborting a cutover no longer waits for the worker, the frames
a rolled-back voice change replays could reach the provider before the
cutover's clear and be discarded with it. Send cutover commands on the
input queue, like resets, so they stay in order with the audio they
clear.

Signed-off-by: John Tennant <jtennant@block.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@johnmatthewtennant

Copy link
Copy Markdown
Contributor Author

🤖 Folded into #416 for review and merge.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant