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:
@@ -202,3 +202,33 @@ def test_provider_decode_failure_has_safe_specific_reason(caplog, raw, reason):
|
||||
assert reason in caplog.text
|
||||
assert raw not in caplog.text
|
||||
asyncio.run(scenario())
|
||||
|
||||
def test_close_deadline_does_not_strand_provider_cleanup(runner, persisted, caplog):
|
||||
async def scenario():
|
||||
runtime, wire, _ = await make(SimpleNamespace(engine=None), runner, persisted)
|
||||
runtime.settings = RuntimeSettings(_env_file=None, send_timeout_seconds=.03)
|
||||
release = asyncio.Event()
|
||||
started = asyncio.Event()
|
||||
|
||||
async def stubborn():
|
||||
started.set()
|
||||
while not release.is_set():
|
||||
try:
|
||||
await release.wait()
|
||||
except asyncio.CancelledError:
|
||||
continue
|
||||
|
||||
task = asyncio.create_task(stubborn())
|
||||
runtime.tasks.add(task)
|
||||
await started.wait()
|
||||
runtime.fail("LIVE_PROVIDER_PROTOCOL_ERROR", writable=False)
|
||||
try:
|
||||
with pytest.raises(TimeoutError):
|
||||
await runtime.close()
|
||||
assert runtime.failure == "LIVE_PROVIDER_PROTOCOL_ERROR"
|
||||
assert runtime._provider_close_task.done()
|
||||
assert "pending_tasks=1" in caplog.text
|
||||
finally:
|
||||
release.set()
|
||||
await task
|
||||
asyncio.run(scenario())
|
||||
Reference in New Issue
Block a user