fix(tts): fall back to raw imports after lazy install failure - #53289
fix(tts): fall back to raw imports after lazy install failure#53289jmeadlock wants to merge 2 commits into
Conversation
|
I checked this against the linked #53259 failure mode, and the patch looks aligned with the root cause: the helpers still try lazy install first, but no longer turn an install-target failure into a hard stop before Python's normal import path can see PYTHONPATH/container-layer packages.\n\nLocal proof using the repo wrapper:\n\n |
|
Thanks for checking and for running the wrapper test suite — appreciated. |
Allow TTS provider import helpers to continue to the normal Python import path when tools.lazy_deps.ensure() fails. This preserves setups where packages are supplied by PYTHONPATH or container image layers instead of the Hermes venv. Adds regression coverage for Edge TTS, ElevenLabs, and Mistral.
fde29c2 to
f2c9045
Compare
Refresh (2026-07-13)
|
|
Thanks for the focused regression fix. The three TTS helper changes match the failure still present on current main in Problems
Suggested changes
Automated hermes-sweeper review. |
Extends the PR's TTS fix to _transcribe_mistral(): a non-ImportError
failure from lazy_deps.ensure("stt.mistral") no longer aborts before
the raw import can see PYTHONPATH/container-layer packages. Adds
regression coverage. Addresses sweeper review on NousResearch#53289.
Sweeper follow-up addressed (2026-07-16)Extended the same fall-through to
No behavior change when |
Summary
Fixes #53259.
This changes the TTS provider import helpers to continue to the normal Python import path when
tools.lazy_deps.ensure()fails. That preserves valid deployments where TTS packages are supplied byPYTHONPATH, shared package directories, or container image layers instead of being installed directly into the Hermes venv.Affected helpers:
_import_edge_tts()_import_elevenlabs()_import_mistral_client()If the raw import is genuinely unavailable, the import statement still raises
ImportError, so existing caller error handling remains intact.Test plan
ImportErrorfailures.uv run python -m pytest tests/tools/test_tts_lazy_import_fallback.py -vuv run python -m pytest tests/tools/test_tts_*.py tests/agent/test_tts_registry.py -quv run ruff check tools/tts_tool.py tests/tools/test_tts_lazy_import_fallback.pyNotes
I also ran an independent review pass on the final diff. No security concerns or logic errors were found.