fix(voice): correct input accounting and session termination
Separate detected speech limits from continuous microphone silence while preserving transport bounds and absolute commit fencing. Handle verified OpenAI cancellation races and terminal items, preserve causal close outcomes, and share bounded cleanup ownership with safe diagnostics. Add regression coverage and align the API contract and frontend handoff. Validation: 61 focused unit tests passed; staged diff whitespace checks passed. Live browser acceptance remains outstanding.
This commit is contained in:
@@ -281,10 +281,12 @@ def test_input_buffer_survives_send_and_commit_releases_only_old_prefix(runner,
|
||||
await runtime.close()
|
||||
asyncio.run(scenario())
|
||||
|
||||
def test_forwarded_input_buffer_overflow_without_commit(runner, persisted):
|
||||
def test_detected_forwarded_speech_overflow_without_commit(runner, persisted):
|
||||
async def scenario():
|
||||
runtime, transport, out = await make(SimpleNamespace(engine=None), runner, persisted)
|
||||
try:
|
||||
await runtime.handle(dict(type="input_audio_buffer.speech_started",
|
||||
item_id="bounded", audio_start_ms=0))
|
||||
for _ in range(50):
|
||||
await runtime.input_audio(bytes(9600))
|
||||
await until(lambda: runtime.input_transport_count == 0)
|
||||
|
||||
Reference in New Issue
Block a user