fix(voice): expand speech buffer to 60s, handle 2.1 cancellation race, and bound cleanup
- Expand max_input_buffer_bytes to 3,072,000 (64s at 24kHz PCM16) with 65s fixed deadline - Broaden response_cancel_not_active race classifier to include gpt-realtime-2.1/shimmer - Add transport abort method and bound cleanup waits during websocket close - Record repair progress in docs/plans/live-conversation-repair-progress.md
This commit is contained in:
@@ -439,6 +439,13 @@ class GeminiLiveAdapter:
|
||||
def is_no_active(self, error):
|
||||
return False
|
||||
|
||||
def abort(self):
|
||||
transport = getattr(self.transport, "transport", None)
|
||||
if transport is None:
|
||||
return False
|
||||
transport.abort()
|
||||
return True
|
||||
|
||||
async def close(self):
|
||||
if self._close_task is None:
|
||||
async def cleanup():
|
||||
|
||||
@@ -156,7 +156,7 @@ class RealtimeAdapter:
|
||||
# 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 == "gpt-realtime-mini" and self.voice == "shimmer"
|
||||
return (self.model in ("gpt-realtime-mini", "gpt-realtime-2.1") and self.voice == "shimmer"
|
||||
and isinstance(error, dict)
|
||||
and error.get("type") == "invalid_request_error"
|
||||
and error.get("code") == "response_cancel_not_active"
|
||||
@@ -164,6 +164,13 @@ class RealtimeAdapter:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def abort(self):
|
||||
transport = getattr(self.transport, "transport", None)
|
||||
if transport is None:
|
||||
return False
|
||||
transport.abort()
|
||||
return True
|
||||
|
||||
async def close(self):
|
||||
await self.transport.close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user