Skip to content

fix(tts): report unknown-provider fallback truthfully - #77932

Open
rungmc357 wants to merge 1 commit into
NousResearch:mainfrom
rungmc357:fix/tts-truthful-unknown-provider-dispatch
Open

fix(tts): report unknown-provider fallback truthfully#77932
rungmc357 wants to merge 1 commit into
NousResearch:mainfrom
rungmc357:fix/tts-truthful-unknown-provider-dispatch

Conversation

@rungmc357

Copy link
Copy Markdown
Contributor

Summary

Unknown TTS provider names have historically fallen back to Edge TTS. The fallback worked, but the success payload still reported the unknown configured provider as the backend that generated the file.

This keeps the fallback behavior for compatibility while reporting it truthfully:

  • provider is now edge, the backend that actually synthesized audio.
  • fallback_from records the unresolved configured or overridden provider name.
  • Other built-in, command, and plugin providers continue reporting their own provider name.
  • If Edge is unavailable and NeuTTS handles the fallback, the payload reports provider: "neutts" while preserving fallback_from.

Regression coverage

Adds an end-to-end dispatch regression that configures an unregistered provider, stubs Edge generation, and verifies that the successful response identifies Edge while retaining the unresolved name in fallback_from.

An independent path review also exercised configured and explicit built-ins, registered plugins, command providers, explicit unknown overrides, fallback generation failure, Edge-to-NeuTTS fallback, and the no-backend-available path.

Validation

  • pytest -q tests/tools/test_tts_plugin_dispatch.py tests/tools/test_tts_command_providers.py tests/agent/test_tts_registry.py tests/tools/test_tts_opus_routing.py
    • 83 passed
  • ruff check tools/tts_tool.py tests/tools/test_tts_plugin_dispatch.py
  • git diff --check origin/main...HEAD

@alt-glitch alt-glitch added type/bug Something isn't working tool/tts Text-to-speech and transcription P3 Low — cosmetic, nice to have labels Aug 3, 2026
@andrexibiza

Copy link
Copy Markdown
Contributor

Verified against current main (70db671fac) as part of the Vox Lockin provider-registry lane — this PR covers the unknown-provider masquerade class and is mergeable; no duplicate needed.

Evidence (live probe, venv python 3.11):

  • Premise on main: text_to_speech_tool with tts.provider: missing-provider falls through to Edge synthesis but returns "provider": "missing-provider" in the success payload — the unknown name masquerades as the engine that produced the audio. ✓ (confirmed by probe)
  • Your head (19595d771d) with the same probe: returns "provider": "edge" + "fallback_from": "missing-provider" — truthful. ✓
  • Tests on your head: tests/tools/test_tts_plugin_dispatch.py + tests/agent/test_tts_registry.py44 passed.
  • git merge-tree --write-tree origin/main pr-77932 exit 0 (clean merge, no conflicts).
  • No review comments on the PR.

Adversarial checks passed:

  • Plugin dispatch still wins when a plugin is actually registered (existing test_plugin_dispatch suite green).
  • The fallback_from key is additive — no existing consumer breaks (response JSON gains a key only when a fallback happened).
  • Edge-unavailable path (NeuTTS fallback) still reports provider: neutts truthfully; the rewrite only touches the unknown-name path.

This PR can merge as-is. (Vox Lockin lane 05 ships #78202 for the other class members: piper lazy-install parity, probe install-safety, null-config guards.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have tool/tts Text-to-speech and transcription type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants