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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user