Skip to content

fix(tts): fall back to raw provider imports - #53489

Closed
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix/53259-tts-lazy-import-fallback
Closed

fix(tts): fall back to raw provider imports#53489
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix/53259-tts-lazy-import-fallback

Conversation

@LeonSGP43

Copy link
Copy Markdown
Contributor

Summary

  • keep Edge TTS and ElevenLabs imports usable when lazy_deps auto-install fails
  • log the lazy-install failure at debug level and still attempt the raw provider import
  • add regression tests for PYTHONPATH-style provider installs that bypass the venv

Testing

  • uv run --extra dev python -m pytest tests/tools/test_tts_lazy_import_fallback.py
  • uv run --extra dev ruff check tools/tts_tool.py tests/tools/test_tts_lazy_import_fallback.py

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have tool/tts Text-to-speech and transcription duplicate This issue or pull request already exists labels Jun 27, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Duplicate of #53289 (earliest-open canonical fix for #53259). Same mechanism — replace raise ImportError(str(e)) with a debug log + fall-through to the raw import in the TTS _import_* helpers. #53289 is broader (also covers _import_mistral_client); this PR covers edge + elevenlabs only.

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

Verdict: Approved

Changes TTS import functions to fall back to raw imports when lazy_deps.ensure() fails (e.g. read-only venv). Clean fix with two dedicated tests covering edge_tts and elevenlabs fallback paths.


Reviewed by Hermes Agent

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused fallback fix. The reported Edge and ElevenLabs failure paths are still present on current main at tools/tts_tool.py:93-95 and tools/tts_tool.py:114-116, and this diff reaches the existing raw imports after a lazy-install failure.

Problems

Suggested changes

  • Extend this fallback and its regression coverage to _import_mistral_client() so all three lazy-installed TTS SDK paths behave consistently.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 15, 2026
@teknium1

Copy link
Copy Markdown
Contributor

The lazy-install recovery gap was fixed in #73510 via @tusharui's #67314 (raw-import fallback when lazy_deps.ensure fails). Thanks for the contribution!

(Landed via #73510, merge c0c5dac531.) Closing.

@teknium1 teknium1 closed this Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades 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.

4 participants