fix(voice): decouple cancellation race handling from model and voice
This commit is contained in:
@@ -424,7 +424,7 @@ Require provider-confirmed cancellation/terminal generation within 5 seconds of
|
||||
|
||||
The backend is the sole cancellation and response-creation owner. Configure private VAD create_response=false AND interrupt_response=false and require provider configuration acknowledgement; VAD still reports speech/commit events. The proof's defaults are not evidence of this configuration. For a known active old response, send at most one response.cancel with that specific private response_id and a unique private event_id mapped to the cancellation intent; never issue a bare cancel that could hit a newer response. Record terminal response.done state by response identity. If completion or provider cancellation was already observed for that response, skip cancellation and proceed to required playback/context cleanup.
|
||||
|
||||
A completion/cancellation racing after the backend's active-state check can produce a no-active-response cancellation error. Only an adapter-verified no-active-response classification tied by error event_id to that one cancellation intent/response is benign by itself: it does not fail the session, retry cancellation or satisfy the terminal/cleanup barrier. Independently require a correlated terminal response.done (completed/cancelled; failed/other incomplete handled as technical failure; the validated audio-only output-token limit below is terminal but limited) within the bounded cancellation deadline, then complete all required context cleanup. A terminal event already recorded satisfies this test; missing terminal confirmation times out and fails. A response identity mismatch, generic/unrelated error, bad arguments, authentication failure or truncation error is not this exception and remains fatal under its normal policy. Official docs establish the benign behavior but not a stable named error code; an exact structured classifier must be proved with the selected provider profile before race acceptance, never infer it from a free-text substring or swallow all cancellation errors.
|
||||
A completion/cancellation racing after the backend's active-state check can produce a no-active-response cancellation error. Only an adapter-verified no-active-response classification tied by error event_id to that one cancellation intent/response is benign by itself: it does not fail the session, retry cancellation or satisfy the terminal/cleanup barrier. Independently require a correlated terminal response.done (completed/cancelled; failed/other incomplete handled as technical failure; the validated audio-only output-token limit below is terminal but limited) within the bounded cancellation deadline, then complete all required context cleanup. A terminal event already recorded satisfies this test; missing terminal confirmation times out and fails. A response identity mismatch, generic/unrelated error, bad arguments, authentication failure or truncation error is not this exception and remains fatal under its normal policy. Official docs establish the benign behavior but not a stable named error code; the exact captured OpenAI structured classifier is provider-protocol scoped, independent of model and voice, and must retain cancellation event-ID correlation plus terminal/cleanup confirmation, never infer it from a free-text substring or swallow all cancellation errors.
|
||||
|
||||
Keep both VAD flags disabled throughout the session. Unexpected automatic generation/cancellation is an observable configuration/protocol deviation; correlate any actual terminal event for cleanup, suppress unintended output and fail if the controlled state cannot be established. The independent response-release gate in 7.1.6 applies even after all cleanup acknowledgements arrive. This is a future runtime obligation, not proof-script behavior.
|
||||
|
||||
@@ -870,3 +870,14 @@ It does not admit other model/voice pairs or relax event-ID correlation,
|
||||
terminal confirmation, final playback positions or truncation acknowledgement.
|
||||
Synthetic regressions reproduce the original rejection, cover both terminal
|
||||
orderings, and retain failure when terminal confirmation is absent.
|
||||
|
||||
|
||||
### OpenAI model-independent cancellation classification (2026-10-14)
|
||||
|
||||
User-authorized amendment superseding the selected-model/voice restriction:
|
||||
OpenAI's captured invalid_request_error / response_cancel_not_active / null-param
|
||||
signature is classified independently of model and voice. Model admission and
|
||||
session setup acknowledgement remain separate. Cancellation event-ID correlation,
|
||||
bounded terminal confirmation, final playback and truncation acknowledgement gates
|
||||
remain mandatory; unknown errors and failed/incomplete technical terminals remain
|
||||
fatal. This change does not establish live acceptance for every OpenAI model.
|
||||
|
||||
Reference in New Issue
Block a user