fix(voice): handle response.cancel no-active race on local S2S provider

- implement LocalS2SAdapter.is_no_active to recognize cancellation of completed or inactive responses
- normalize local S2S history handler cancellation error to standard response_cancel_not_active contract
- align calibration distance for measured BGE-M3 search threshold
This commit is contained in:
amirhosein mazaheri
2026-10-17 17:01:28 +03:30
parent 5bb6945377
commit 2bffb9476a
3 changed files with 17 additions and 4 deletions
+3 -1
View File
@@ -171,7 +171,9 @@ def install_retained_history():
if raw.get('type') == 'response.cancel':
st = service._state(session_id)
if not st.in_response or raw.get('response_id') != st.current_response_id:
error = service.make_error('Cancellation identity mismatch', 's2s_history_failed')
error = service.make_error('Cancellation identity mismatch', 'invalid_request_error')
error.error.code = 'response_cancel_not_active'
error.error.param = None
error.error.event_id = raw.get('event_id')
await transport.send_events([error])
return