ElevenLabs: degrade gracefully when /with-timestamps is rejected - #35
Merged
Conversation
The with-timestamps endpoint variant was appended unconditionally whenever boundaries were requested — its model coverage is not documented for eleven_v3, so a boundary-requesting call on v3 could hard-fail. Now a rejected variant retries the plain synthesis endpoint and flows into the streaming path with estimated boundaries (real failures — auth, quota — still surface from the retry). Also: the estimation plan is built from the caller-facing text, not the processed prompt, so injected audio tags are never estimated as words; and a boundaries-only degraded request now streams (previously the streaming branch required an on_audio callback, which would have delivered no boundaries at all).
Merged
3 tasks
Std-TcpListener mock serving a 404 on /with-timestamps then a 200 MP3 (0.4s silence fixture, ffmpeg-generated): asserts the variant is attempted first, dropped on retry, and estimated boundaries fire with offsets resolving in the caller's text — the boundaries-only degraded entry included. No API key needed.
3 tasks
willwade
added a commit
that referenced
this pull request
Sep 4, 2026
The test file added in #35 was merged on stale green checks: its final commit actually failed lint.yml/test.yml (unused TtsEngine import, doc_markdown, map_unwrap_or under clippy pedantic -D warnings), leaving main red. Fix the lints; verified against the exact CI command (clippy --all-targets -- -D warnings with the Linux feature set) and cargo fmt --all --check.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #34. The
/with-timestampsendpoint variant was appended unconditionally whenever word boundaries were requested, for any model — but its model coverage is not documented foreleven_v3, so a boundary-requesting call on v3 could hard-fail with an opaque API error.boundary_search_text), not the processed prompt — injected audio tags ([whispers] …) are never estimated as spoken "words".on_audiocallback, which would have delivered audio but no boundaries at all).This is the "support v3 as fully as we can" robustness piece that needs no API key: the fallback is empirically safe whichever way the live verification lands — if v3 supports the variant you get real character alignment, if not you get estimates instead of an error.
Test plan
ELEVENLABS_API_KEY(either outcome is now a pass; which path ran is observable)