Skip to content

The agent that grows with you

fix(doctor): probe the Docker daemon with 'docker version', not 'docker info' (#72927)

kshitijk4poor60ca93cebd7a
diff --git a/hermes_cli/doctor_tools.py b/hermes_cli/doctor_tools.py
index 8c66fb9a7b7..2cc87886347 100644
--- a/hermes_cli/doctor_tools.py
+++ b/hermes_cli/doctor_tools.py
@@ -138,7 +138,10 @@ def _check_docker_backend(terminal_env: str, running_in_container: bool, issues:
if not _safe_which("docker"):
_fail_and_issue("docker not found", "(required for TERMINAL_ENV=docker)", "Install Docker or change TERMINAL_ENV", issues)
else:
- _require(_run_ok(["docker", "info"], timeout=10), ("docker", "(daemon running)"), ("docker daemon not running", ""),
+ # `docker version` hits /version, which socket proxies (tecnativa) allow by default; `docker info`
+ # needs /info and is commonly blocked, giving a false "daemon not running". The backend itself
+ # probes with `docker version` too (environments/docker.py).
+ _require(_run_ok(["docker", "version"], timeout=10), ("docker", "(daemon running)"), ("docker daemon not running", ""),
"Start Docker daemon", issues)
elif _safe_which("docker"):
check_ok("docker", "(optional)")
diff --git a/tests/hermes_cli/test_doctor.py b/tests/hermes_cli/test_doctor.py
index 9b4cee69bcc..74394e98772 100644
--- a/tests/hermes_cli/test_doctor.py
+++ b/tests/hermes_cli/test_doctor.py
@@ -1742,3 +1742,19 @@ def test_run_doctor_warns_when_lightpanda_binary_missing(monkeypatch, tmp_path):
monkeypatch.setattr("tools.browser_lightpanda.find_lightpanda_binary", lambda: None)
out = helper._run_doctor_and_capture(monkeypatch, tmp_path)
assert "Lightpanda selected but binary not found" in out
+
+
+def test_docker_daemon_probe_uses_version_not_info(monkeypatch):
+ """`docker info` needs the /info endpoint, which socket proxies commonly block, so doctor reported
+ "daemon not running" against a working DOCKER_HOST (#72927). `docker version` (/version) is what the
+ backend itself probes with."""
+ from hermes_cli import doctor_tools
+
+ calls: list = []
+ monkeypatch.setattr(doctor_tools, "_safe_which", lambda name: "/usr/bin/docker")
+ monkeypatch.setattr(doctor_tools, "_run_ok", lambda cmd, timeout, **kw: calls.append(cmd) or True)
+ monkeypatch.setattr(doctor_tools, "_require", lambda *a, **k: None)
+
+ doctor_tools._check_docker_backend("docker", False, [])
+
+ assert calls and calls[0][:2] == ["docker", "version"]