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
+5 -9
View File
@@ -195,15 +195,11 @@ class RealtimeAdapter:
try:
if self.no_active_classifier is not None:
return self.no_active_classifier(error) is True
# Selected-profile probe: docs/guides/live-context-sync-repair.md.
# The runtime separately requires the cancellation intent event_id,
# terminal response confirmation, and heard-position truncation.
return ((self.model, self.voice) in {
("gpt-realtime-mini", "shimmer"),
("gpt-realtime-2.1", "shimmer"),
("gpt-realtime-2.1", "marin"),
}
and isinstance(error, dict)
# Captured structured OpenAI signature; independent of model/voice.
# Runtime still requires the cancellation intent event_id, terminal
# response confirmation, and heard-position truncation acknowledgements.
# Unknown signatures remain failures; never match provider message text.
return (isinstance(error, dict)
and error.get("type") == "invalid_request_error"
and error.get("code") == "response_cancel_not_active"
and error.get("param") is None)