Skip to content

fix(elevenlabs): set a request timeout on batch STT recognize - #8647

Merged
longcw merged 1 commit into
livekit:mainfrom
Caezarr:fix/elevenlabs-batch-stt-timeout
Nov 19, 2026
Merged

longcw merged 1 commit into
livekit:mainfrom
Caezarr:fix/elevenlabs-batch-stt-timeout

Conversation

@Caezarr

@Caezarr Caezarr commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Batch recognize() in the ElevenLabs STT posted without a timeout, so it used the session default (5 minutes for the shared http_context session) and conn_options.timeout had no effect. This applies the same timeout as the plugin's TTS: aiohttp.ClientTimeout(total=30, sock_connect=conn_options.timeout).

Fixes #8646

  • pass the timeout to the post() in STT._recognize_impl
  • add test_recognize_sets_a_request_timeout (fails without the change)

Testing:

  • pytest tests/test_plugin_elevenlabs_stt.py --plugin elevenlabs: 132 passed
  • ruff check, ruff format --check, mypy on the plugin: clean
  • against a local server that answers in 40 s: before, recognize() returned after 40.0 s, after, it raises APITimeoutError after 30.6 s. Not run against the live ElevenLabs API.
  • tests/test_plugin_elevenlabs_tts.py::test_prewarm_stops_on_non_retryable_api_error fails locally on main too, without this change.

@Caezarr
Caezarr requested a review from a team as a code owner November 18, 2026 17:13

@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 bugs or issues to report.

Devin Review

@longcw
longcw merged commit 8dc9390 into livekit:main Nov 19, 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.

ElevenLabs STT: batch recognize() has no request timeout (session default of 5 minutes applies)

2 participants