fix(voice): decouple cancellation race handling from model and voice

This commit is contained in:
amirhosein mazaheri
2026-10-14 12:04:08 +03:30
parent 15558fd850
commit 1f7c2bd195
8 changed files with 134 additions and 23 deletions
+1 -3
View File
@@ -1752,9 +1752,7 @@ class VoiceRuntime:
cancellation_type_match=int(error.get("type") == "invalid_request_error"),
cancellation_code_match=int(error.get("code") == "response_cancel_not_active"),
cancellation_param_match=int(error.get("param") is None),
cancellation_profile_2_1_shimmer=int(
getattr(self.adapter, "model", None) == "gpt-realtime-2.1"
and getattr(self.adapter, "voice", None) == "shimmer"))
cancellation_correlated=1)
self.sync_failed("CANCELLATION_PROVIDER_ERROR", turn=matches[0].turn, phase="provider_handle", event_type=kind)
elif cleanup:
self.sync_failed("TRUNCATION_PROVIDER_ERROR", turn=cleanup.response.turn, phase="provider_handle", event_type=kind, audio=cleanup)