Skip to content

fix: raise on unexpected ElevenLabs websocket close#5729

Merged
theomonnom merged 1 commit into
livekit:mainfrom
nightcityblade:fix/issue-5720
May 13, 2026
Merged

fix: raise on unexpected ElevenLabs websocket close#5729
theomonnom merged 1 commit into
livekit:mainfrom
nightcityblade:fix/issue-5720

Conversation

@nightcityblade
Copy link
Copy Markdown
Contributor

Summary

Raise immediately when the ElevenLabs TTS websocket closes while contexts are still pending.

Changes

  • Convert unexpected websocket close events with active contexts into APIStatusError
  • Preserve normal close behavior when there are no pending contexts

Testing

  • python3 -m compileall -q livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/tts.py
  • uv run python -m compileall -q livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/tts.py
  • uv run ruff check livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/tts.py
  • uv run pytest tests/test_plugin_elevenlabs_tts.py

Fixes #5720

@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.

Copy link
Copy Markdown
Contributor

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

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

@theomonnom theomonnom merged commit 37131a3 into livekit:main May 13, 2026
16 of 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.

fix(elevenlabs): raise on unexpected WebSocket close in TTS recv loop

3 participants