Skip to content

fix(cartesia): clear aligned_transcript when the combo cannot deliver timestamps - #6637

Open
biztex wants to merge 1 commit into
livekit:mainfrom
biztex:fix/cartesia-aligned-transcript-capability
Open

fix(cartesia): clear aligned_transcript when the combo cannot deliver timestamps#6637
biztex wants to merge 1 commit into
livekit:mainfrom
biztex:fix/cartesia-aligned-transcript-capability

Conversation

@biztex

@biztex biztex commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Fixes #6493

Implements the fix direction confirmed by @chenghao-mou on the issue ("we should validate the user input and disable it with a warning"). Credit to @onurburak9 for the precise analysis — happy to hand this back if you were mid-way on your own PR.

Problem

cartesia.TTS(word_timestamps=True) — the default — set capabilities.aligned_transcript=True unconditionally at construction. For model/language combinations Cartesia documents as unable to return timing data, the plugin warned about the combination but left the capability set, so use_tts_aligned_transcript selected the TTS-aligned path every turn and produced the recurring warning: use_tts_aligned_transcript is enabled but no agent transcript was returned from tts.

Change

Validation moves to construction: when the model/language combination cannot deliver word timestamps (per Cartesia's endpoint-comparison docs — non-preview models only support en/de/es/fr), word_timestamps is disabled with one clear warning. That both clears capabilities.aligned_transcript (downstream falls back to forwarded text, no per-turn warnings) and stops requesting timestamps the API won't return. An explicit word_timestamps=False opt-out stays silent. The support predicate is a small named helper with the docs link.

Scoped deliberately: elevenlabs' sync_alignment narrowing needs provider knowledge about which of its model/language combos deliver alignment (no documented in-plugin check exists to promote), and the timed_texts_fut truthiness question in generation.py from the issue is a separate design discussion.

Tests

New hermetic tests/test_cartesia_tts_capabilities.py (9 cases): the support predicate across sonic/preview models, locale normalization (en-USen), and capability narrowing at construction — set for supported combos, cleared (with the warning, and with _opts.word_timestamps=False) for unsupported ones, silent on explicit opt-out.

… timestamps

word_timestamps=True (the default) set capabilities.aligned_transcript=True
unconditionally at construction. For model/language combinations Cartesia
documents as unable to return timing data, the plugin warned about the
combination but left the capability set - so every turn downstream selected
the TTS-aligned transcript path and warned that no agent transcript was
returned from tts.

Validate at construction instead: when the combination cannot deliver word
timestamps, disable word_timestamps with a single clear warning, which both
clears the capability and stops requesting timestamps from the API. An
explicit word_timestamps=False opt-out stays silent.

Fixes livekit#6493
@biztex
biztex requested a review from a team as a code owner July 31, 2026 06:47

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

View in Devin Review to see 2 additional findings.

Open in Devin Review

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.

Is capabilities.aligned_transcript meant to reflect requested vs. actually-delivered alignment?

1 participant