mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-29 06:31:32 +00:00
fix(tts): tolerate missing hermes_cli.config in tts_tool import
Wrap the new top-level `from hermes_cli.config import get_env_value` in try/except ImportError and fall back to a thin os.getenv shim, so importing tools.tts_tool keeps working in environments where hermes_cli.config is unavailable. This matches the existing tolerance in `_load_tts_config()` (tools/tts_tool.py) and the same import-fallback pattern in tools/tool_backend_helpers.py::fal_key_is_configured. Also update the TestDotenvFallbackPerProvider docstring to accurately describe the mocking strategy: per-provider tests patch `tools.tts_tool.get_env_value` directly, while the regression-guard tests cover the lower-level `hermes_cli.config.load_env` integration. Addresses Copilot review on #17163. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
40d25e125b
commit
33967b4e52
2 changed files with 11 additions and 4 deletions
|
|
@ -44,7 +44,11 @@ from urllib.parse import urljoin
|
|||
from hermes_constants import display_hermes_home
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
from hermes_cli.config import get_env_value
|
||||
try:
|
||||
from hermes_cli.config import get_env_value
|
||||
except ImportError:
|
||||
def get_env_value(name, default=None):
|
||||
return os.getenv(name, default)
|
||||
from tools.managed_tool_gateway import resolve_managed_tool_gateway
|
||||
from tools.tool_backend_helpers import managed_nous_tools_enabled, prefers_gateway, resolve_openai_audio_api_key
|
||||
from tools.xai_http import hermes_xai_user_agent
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue