From bb4cb02f54414bd842f8bb07f34d53c90eadf39e Mon Sep 17 00:00:00 2001 From: kyssta-exe Date: Wed, 17 Jun 2026 17:08:22 +0000 Subject: [PATCH] fix(terminal): check Git-for-Windows paths before shutil.which on Windows (#47837) --- tools/environments/local.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/environments/local.py b/tools/environments/local.py index 1fdc3589236f4..5cb2e15bb9b85 100644 --- a/tools/environments/local.py +++ b/tools/environments/local.py @@ -251,8 +251,6 @@ def _find_bash() -> str: return candidate found = shutil.which("bash") - if found: - return found for candidate in ( os.path.join(os.environ.get("ProgramFiles", r"C:\Program Files"), "Git", "bin", "bash.exe"), @@ -262,6 +260,9 @@ def _find_bash() -> str: if candidate and os.path.isfile(candidate): return candidate + if found: + return found + raise RuntimeError( "Git Bash not found. Hermes Agent requires Git for Windows on Windows.\n" "Install it from: https://git-scm.com/download/win\n"