From b4bfe5b3f29f43bffd9aecfbc745db965ac9f160 Mon Sep 17 00:00:00 2001 From: ethernet Date: Thu, 30 Jul 2026 15:58:41 -0400 Subject: [PATCH] fix: doctor + termux-audio container-env parity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - doctor: 'inside a container' branch rewrote terminal_env to local for EVERY non-docker backend, so TERMINAL_ENV=vercel_sandbox diagnostics vanished when doctor ran inside a container (CI runner pods). Scope the informational skip to the implicit local case only; remote backends keep their real diagnostics. Fixes test_doctor_reports_vercel_backend_diagnostics on ARC runners — and for actual users running doctor in the Docker distribution with a remote terminal backend configured. - termux audio test: detect_audio_environment() probes the real host for containment; pin is_container=False (a Termux device is never a container) so the containerized runner doesn't flip available=False. --- hermes_cli/doctor.py | 7 ++++--- tests/tools/test_termux_api_detection.py | 6 ++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/hermes_cli/doctor.py b/hermes_cli/doctor.py index 18ea422f3e2..0446f39d7f6 100644 --- a/hermes_cli/doctor.py +++ b/hermes_cli/doctor.py @@ -1727,13 +1727,14 @@ def run_doctor(args): # not found" warning. If the user has explicitly chosen # TERMINAL_ENV=docker inside the container they likely mounted # /var/run/docker.sock, so fall through to the normal check. - if terminal_env != "docker": + # Only the implicit local-vs-docker choice is affected: remote + # backends (ssh, daytona, vercel_sandbox, ...) work fine from + # inside a container and must keep their real diagnostics. + if terminal_env == "local": check_info( "Running inside a container — using local terminal backend " "(docker-in-docker is not configured by default)" ) - # Skip to next section; Docker isn't relevant here. - terminal_env = "local" if terminal_env == "docker": if _safe_which("docker"): # Check if docker daemon is running diff --git a/tests/tools/test_termux_api_detection.py b/tests/tools/test_termux_api_detection.py index c1406c4585a..506655bc3c5 100644 --- a/tests/tools/test_termux_api_detection.py +++ b/tests/tools/test_termux_api_detection.py @@ -166,6 +166,12 @@ class TestDetectAudioEnvironmentTermuxFallback: monkeypatch.delenv("SSH_CLIENT", raising=False) monkeypatch.delenv("SSH_TTY", raising=False) monkeypatch.delenv("SSH_CONNECTION", raising=False) + # detect_audio_environment() also probes the REAL host for + # containment; a containerized CI runner would append the + # container warning and flip available=False. A Termux device is + # never a container — pin the probe to the scenario under test. + import hermes_constants + monkeypatch.setattr(hermes_constants, "is_container", lambda: False) # No sounddevice — we go down the Termux:API branch. monkeypatch.setattr(