Skip to content

fix(elevenlabs): restore chunk length schedule in WS init#1421

Merged
u9g merged 1 commit intomainfrom
thoraxes-ulna-gnarls
May 8, 2026
Merged

fix(elevenlabs): restore chunk length schedule in WS init#1421
u9g merged 1 commit intomainfrom
thoraxes-ulna-gnarls

Conversation

@u9g
Copy link
Copy Markdown
Contributor

@u9g u9g commented May 7, 2026

Summary

  • restore generation_config.chunk_length_schedule in ElevenLabs multi-context websocket init packets
  • keep existing default auto_mode=True for normal usage, but default to auto_mode=False when chunk_length_schedule is explicitly provided so the schedule is not implicitly disabled
  • refactor init packet construction into a helper for deterministic unit coverage

Why

chunk_length_schedule has been accepted/stored by the plugin but not forwarded in current multi-context websocket flow, making it a no-op in practice.

Changes

  • livekit/plugins/elevenlabs/tts.py
    • add _build_context_init_packet(...) to include:
      • text
      • voice_settings
      • context_id
      • generation_config.chunk_length_schedule when provided
      • pronunciation_dictionary_locators when provided
    • use this helper in _Connection._send_loop() init path
    • set constructor defaulting to auto_mode = not is_given(chunk_length_schedule) when auto_mode is not explicitly provided

Tests

Added tests/test_plugin_elevenlabs_tts.py covering:

  • auto_mode defaults with and without explicit chunk schedule
  • explicit auto_mode override precedence
  • init packet includes generation_config when schedule is set
  • init packet omits generation_config when schedule is unset
  • pronunciation dictionary locators are preserved in init packet

Run locally:

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

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 7, 2026

🦋 Changeset detected

Latest commit: f654669

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 30 packages
Name Type
@livekit/agents-plugin-elevenlabs Patch
@livekit/agents Patch
@livekit/agents-plugin-anam Patch
@livekit/agents-plugin-assemblyai Patch
@livekit/agents-plugin-baseten Patch
@livekit/agents-plugin-bey Patch
@livekit/agents-plugin-cartesia Patch
@livekit/agents-plugin-cerebras Patch
@livekit/agents-plugin-deepgram Patch
@livekit/agents-plugin-fishaudio Patch
@livekit/agents-plugin-google Patch
@livekit/agents-plugin-hedra Patch
@livekit/agents-plugin-inworld Patch
@livekit/agents-plugin-lemonslice Patch
@livekit/agents-plugin-liveavatar Patch
@livekit/agents-plugin-livekit Patch
@livekit/agents-plugin-minimax Patch
@livekit/agents-plugin-mistral Patch
@livekit/agents-plugin-mistralai Patch
@livekit/agents-plugin-neuphonic Patch
@livekit/agents-plugin-openai Patch
@livekit/agents-plugin-phonic Patch
@livekit/agents-plugin-resemble Patch
@livekit/agents-plugin-rime Patch
@livekit/agents-plugin-runway Patch
@livekit/agents-plugin-sarvam Patch
@livekit/agents-plugin-silero Patch
@livekit/agents-plugin-trugen Patch
@livekit/agents-plugin-xai Patch
@livekit/agents-plugins-test Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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

Open in Devin Review

@u9g u9g enabled auto-merge (squash) May 7, 2026 20:13
@u9g u9g merged commit 121d84c into main May 8, 2026
9 checks passed
@u9g u9g deleted the thoraxes-ulna-gnarls branch May 8, 2026 01:25
@github-actions github-actions Bot mentioned this pull request May 8, 2026
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