fix(voice): decouple cancellation race handling from model and voice
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user