fix(openai): warn when semantic_vad is configured with Azure Realtime - #6871
fix(openai): warn when semantic_vad is configured with Azure Realtime#6871CrimsonSithria wants to merge 1 commit into
Conversation
Azure OpenAI Realtime has been observed to accept a semantic_vad session config but never emit input_audio_buffer.speech_started, so server-side interruption/barge-in silently never fires (the same audio under server_vad works). This is presumably why AZURE_DEFAULT_TURN_DETECTION is already server_vad, but nothing stops or warns a user who explicitly opts into semantic_vad via with_azure(). Add a logger.warning on explicit semantic_vad in with_azure(), document the caveat in the docstring, and record the rationale next to AZURE_DEFAULT_TURN_DETECTION. No behavior change. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
You have reached your Codex usage limits for security reviews. Please try again later. |
|
|
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d54efba3e9
βΉοΈ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| can_disable_turn_detection = not is_given(turn_detection) | ||
| if not is_given(turn_detection): | ||
| turn_detection = AZURE_DEFAULT_TURN_DETECTION | ||
| elif turn_detection is not None and getattr(turn_detection, "type", None) == "semantic_vad": |
There was a problem hiding this comment.
Warn on every supported Azure configuration path
When callers use the supported Azure constructor directly (RealtimeModel(azure_deployment=..., turn_detection=SemanticVad(...))) or later select semantic VAD through update_options, this branch never executes because it exists only in with_azure(). Those configurations have the same broken Azure barge-in behavior but remain silent; move or share the Azure-aware check with the constructor and option-update paths.
Useful? React with πΒ / π.
Azure OpenAI Realtime (observed on
gpt-realtimedeployments, raw WebSocket, Aug 2026) accepts asemantic_vadsession config βsession.updatedreflects it β but then never emitsinput_audio_buffer.speech_startedand never cancels an active response. Server-side interruption/barge-in is silently dead. The identical audio injected underserver_vadfiresspeech_startedand cancels withreason: turn_detected.This appears to be why
AZURE_DEFAULT_TURN_DETECTIONis alreadyserver_vad(while the OpenAI default issemantic_vad) β but nothing warns a user who explicitly opts intosemantic_vadviawith_azure(), and thewith_azuredocstring's own example configuressemantic_vad.Changes (warning-only, no behavior change)
logger.warninginwith_azure()when the caller explicitly passessemantic_vadturn detectionturn_detectionarg docsAZURE_DEFAULT_TURN_DETECTIONCorroboration
speech_started+ cancellation) against Azuregpt-realtime-2.1; happy to share the repro script if useful.If/when Azure fixes this server-side, the warning can simply be removed.