Skip to content

fix(elevenlabs): end server vad turns#5872

Merged
chenghao-mou merged 3 commits into
livekit:mainfrom
he-yufeng:fix/elevenlabs-server-vad-eos
Jun 10, 2026
Merged

fix(elevenlabs): end server vad turns#5872
chenghao-mou merged 3 commits into
livekit:mainfrom
he-yufeng:fix/elevenlabs-server-vad-eos

Conversation

@he-yufeng

Copy link
Copy Markdown
Contributor

Summary

  • map ElevenLabs server-VAD committed transcripts to LiveKit END_OF_SPEECH
  • leave manual commit behavior unchanged: manual streams still wait for an empty commit before EOS
  • avoid treating an omitted server_vad option as server VAD when building the realtime websocket URL

To verify

  • python -m py_compile livekit-plugins\livekit-plugins-elevenlabs\livekit\plugins\elevenlabs\stt.py tests\test_plugin_elevenlabs_stt.py
  • uv run ruff check livekit-plugins\livekit-plugins-elevenlabs\livekit\plugins\elevenlabs\stt.py tests\test_plugin_elevenlabs_stt.py
  • uv run pytest tests/test_plugin_elevenlabs_stt.py -q --basetemp .tmp\pytest-5849 -p no:cacheprovider

Related: #5849

@CLAassistant

CLAassistant commented May 28, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@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 3 additional findings.

Open in Devin Review

@he-yufeng he-yufeng force-pushed the fix/elevenlabs-server-vad-eos branch from 8d4efee to 6a54627 Compare June 5, 2026 03:16
devin-ai-integration[bot]

This comment was marked as resolved.

@davidzhao davidzhao requested a review from a team June 9, 2026 16:08
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@chenghao-mou chenghao-mou self-requested a review June 10, 2026 09:16
Comment thread livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/stt.py Outdated

@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 found 1 new potential issue.

View 4 additional findings in Devin Review.

Open in Devin Review

async def _connect_ws(self) -> aiohttp.ClientWebSocketResponse:
"""Establish WebSocket connection to ElevenLabs Scribe v2 API"""
commit_strategy = "manual" if self._opts.server_vad is None else "vad"
commit_strategy = "vad" if self._server_vad is not None else "manual"

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.

🚩 Fix for pre-existing bug: NOT_GIVEN incorrectly treated as VAD-enabled

The old code at livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/stt.py:488 had commit_strategy = "manual" if self._opts.server_vad is None else "vad". Since the default value of server_vad is NOT_GIVEN (not None), the is None check evaluated to False, causing commit_strategy to be "vad" for every user who didn't explicitly pass server_vad. The new _server_vad property correctly normalizes both NOT_GIVEN and None to None, fixing the default commit strategy to "manual". This is a behavioral change for all users relying on the default β€” they were previously getting server-side VAD without knowing it.

Open in Devin Review

Was this helpful? React with πŸ‘ or πŸ‘Ž to provide feedback.

@chenghao-mou chenghao-mou merged commit 2c1cbd6 into livekit:main Jun 10, 2026
17 checks passed
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.

5 participants