Skip to content

fix(openai): warn when semantic_vad is configured with Azure Realtime - #6871

Open
CrimsonSithria wants to merge 1 commit into
livekit:mainfrom
CrimsonSithria:fix/azure-semantic-vad-warning
Open

fix(openai): warn when semantic_vad is configured with Azure Realtime#6871
CrimsonSithria wants to merge 1 commit into
livekit:mainfrom
CrimsonSithria:fix/azure-semantic-vad-warning

Conversation

@CrimsonSithria

@CrimsonSithria CrimsonSithria commented Aug 15, 2026

Copy link
Copy Markdown

Azure OpenAI Realtime (observed on gpt-realtime deployments, raw WebSocket, Aug 2026) accepts a semantic_vad session config β€” session.updated reflects it β€” but then never emits input_audio_buffer.speech_started and never cancels an active response. Server-side interruption/barge-in is silently dead. The identical audio injected under server_vad fires speech_started and cancels with reason: turn_detected.

This appears to be why AZURE_DEFAULT_TURN_DETECTION is already server_vad (while the OpenAI default is semantic_vad) β€” but nothing warns a user who explicitly opts into semantic_vad via with_azure(), and the with_azure docstring's own example configures semantic_vad.

Changes (warning-only, no behavior change)

  • logger.warning in with_azure() when the caller explicitly passes semantic_vad turn detection
  • caveat added to the turn_detection arg docs
  • rationale comment next to AZURE_DEFAULT_TURN_DETECTION

Corroboration

If/when Azure fixes this server-side, the warning can simply be removed.

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>
@CrimsonSithria
CrimsonSithria requested a review from a team as a code owner August 15, 2026 23:06
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

βœ… Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ’‘ 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":

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 πŸ‘Β / πŸ‘Ž.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants