fix: deduplicate _is_termux() into hermes_constants.is_termux()

Replace 6 identical copies of the Termux detection function across
cli.py, browser_tool.py, voice_mode.py, status.py, doctor.py, and
gateway.py with a single shared implementation in hermes_constants.py.

Each call site imports with its original local name to preserve all
existing callers (internal references and test monkeypatches).
This commit is contained in:
Teknium 2026-04-09 14:53:02 -07:00 committed by Teknium
parent c3141429b7
commit 69a0092c38
7 changed files with 16 additions and 18 deletions

View file

@ -285,9 +285,7 @@ def _get_cloud_provider() -> Optional[CloudBrowserProvider]:
return _cached_cloud_provider
def _is_termux_environment() -> bool:
prefix = os.getenv("PREFIX", "")
return bool(os.getenv("TERMUX_VERSION") or "com.termux/files/usr" in prefix)
from hermes_constants import is_termux as _is_termux_environment
def _browser_install_hint() -> str: