fix(voice): keep Realtime calls alive after cancellation races - #318
Draft
johnmatthewtennant wants to merge 1 commit into
Draft
johnmatthewtennant wants to merge 1 commit into
johnmatthewtennant wants to merge 1 commit into
Conversation
Track coordinator cancellation requests and consume correlated no-active-response errors before forwarding provider events to the host. Preserve fatal handling for unrelated and unexpected errors. Validation: Blox jtennant-berd-cancel-race-20260910 at base 5d5708e; 256 voice library tests and 24 protocol tests passed, plus just fmt-check, check, tauri-check, and clippy. Local changed file is byte-identical to the validated tree (SHA-256 2cf53b9b7e542ccc73e935627d69e26fb18d0c1e2fb0b15afcf48a7e45e0c0a5). Supplemental all-targets Clippy diagnostics also reproduce on unchanged main. Signed-off-by: John Tennant <jtennant@block.xyz>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes an OpenAI Realtime call ending with “Cancellation failed: no active response found” when a response finishes before its cancellation reaches the provider. Coordinator cancellations carry tracked event IDs, and the matching no-active-response error is consumed before provider events reach the host's fatal-error reducer. Unrelated errors and other cancellation failures remain visible.
Runtime regressions reproduce the cancellation failure on the base commit and verify that a subsequent speech-start event is processed after the fix. They also preserve failures for uncorrelated errors and unexpected cancellation failures. This coverage uses a local WebSocket test provider; live OpenAI audio and the macOS call UI remain unverified.