Bug Description
When using elevenlabs.STT (version 1.3.6) in streaming mode, if the WebSocket connection drops mid-stream (e.g., due to network instability or ElevenLabs service issues), the SpeechStream raises APIStatusError with retryable=True but does not attempt to reconnect. The stream effectively dies, and my transcription becomes non-English characters. I also see LiveKit start repeating the same sentence (I am not sure this repeat behavior is related to stream issue).
Current Behavior
SpeechStream._run() establishes WebSocket connection via _connect_ws()
recv_task monitors incoming messages
- When WebSocket closes unexpectedly,
recv_task raises:
APIStatusError: ElevenLabs STT connection closed unexpectedly (status_code=-1, request_id=None, body=None, retryable=True)
- Exception propagates through
task.result() and breaks out of the while True loop
- Stream ends without reconnection attempt
- AgentSession receives error with
recoverable=True
Expected Behavior
Either:
-
Plugin-level: SpeechStream should catch connection errors and attempt reconnection (similar to how _reconnect_event triggers reconnection for update_options)
-
Framework-level: AgentSession should recreate STT streams when receiving recoverable STT errors
Relevant Code
In stt.py, the _run method's reconnection logic only triggers on _reconnect_event:
async def _run(self) -> None:
while True:
try:
ws = await self._connect_ws()
# ... tasks created ...
for task in done:
if task != wait_reconnect_task:
task.result() # <-- Exception raised here breaks out of loop
if wait_reconnect_task not in done:
break # <-- Exits loop on error
self._reconnect_event.clear() # <-- Only reconnects if event was set
Reproduction Steps
- Configure
AgentSession with elevenlabs.STT, set realtime to True to use Scribe V2
- Start a voice conversation
- Just talk with agent for a few minutes in LiveKit playground
- Observe error in logs with
retryable=True, and my transcription becomes non-English characters.
This is how I create a session with ElevenLabs STT:
from livekit.plugins import elevenlabs,
params = {"use_realtime": True}
stt = elevenlabs.STT(**params)
...
session = AgentSession[ParticipantData](
userdata=participant_data,
stt=stt, # scribe v2
llm=llm, # OpenAI "gpt-5" model
tts=tts, # eleven_multilingual_v2
)
Operating System
MacOS
Models Used
Scribe V2
Package Versions
livekit-agents~=1.3.6
livekit-api~=1.1.0
livekit-plugins-elevenlabs~=1.3.6
Python: 3.11
Screenshots and Recordings

Bug Description
When using
elevenlabs.STT(version1.3.6) in streaming mode, if the WebSocket connection drops mid-stream (e.g., due to network instability or ElevenLabs service issues), theSpeechStreamraisesAPIStatusErrorwithretryable=Truebut does not attempt to reconnect. The stream effectively dies, and my transcription becomes non-English characters. I also see LiveKit start repeating the same sentence (I am not sure this repeat behavior is related to stream issue).Current Behavior
SpeechStream._run()establishes WebSocket connection via_connect_ws()recv_taskmonitors incoming messagesrecv_taskraises:task.result()and breaks out of thewhile Truelooprecoverable=TrueExpected Behavior
Either:
Plugin-level:
SpeechStreamshould catch connection errors and attempt reconnection (similar to how_reconnect_eventtriggers reconnection forupdate_options)Framework-level:
AgentSessionshould recreate STT streams when receiving recoverable STT errorsRelevant Code
In
stt.py, the_runmethod's reconnection logic only triggers on_reconnect_event:Reproduction Steps
AgentSessionwithelevenlabs.STT, setrealtimetoTrueto useScribe V2retryable=True, and my transcription becomes non-English characters.This is how I create a session with ElevenLabs STT:
Operating System
MacOS
Models Used
Scribe V2
Package Versions
Screenshots and Recordings