Skip to content

fix(windows): prefer Git Bash before PATH bash - #47854

Closed
tt-a1i wants to merge 1 commit into
NousResearch:mainfrom
tt-a1i:codex/windows-git-bash-before-path
Closed

fix(windows): prefer Git Bash before PATH bash#47854
tt-a1i wants to merge 1 commit into
NousResearch:mainfrom
tt-a1i:codex/windows-git-bash-before-path

Conversation

@tt-a1i

@tt-a1i tt-a1i commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • move known Git-for-Windows install paths ahead of the generic shutil.which("bash") fallback in _find_bash()
  • keep the existing higher priorities intact: HERMES_GIT_BASH_PATH first, then Hermes-managed PortableGit/MinGit
  • add regression coverage for the native Windows case where PATH resolves bash to the WSL launcher while ProgramFiles\Git\bin\bash.exe exists

Fixes #47837.

Related PRs

This is narrower than #35675 and #38092:

Testing

  • $HOME/.hermes/hermes-agent/venv/bin/python -m pytest tests/tools/test_local_find_bash.py -q
  • $HOME/.hermes/hermes-agent/venv/bin/python -m pytest tests/tools/test_local_env_cwd_recovery.py tests/tools/test_local_env_blocklist.py tests/tools/test_local_find_bash.py -q
  • $HOME/.hermes/hermes-agent/venv/bin/python -m compileall -q tools/environments/local.py tests/tools/test_local_find_bash.py
  • git diff --check

Review

A read-only subagent review found no blocking issues and confirmed this is an independent narrow fix for #47837, not a duplicate of #35675/#38092.

@alt-glitch alt-glitch added type/bug Something isn't working tool/terminal Terminal execution and process management P2 Medium — degraded but workaround exists labels Jun 17, 2026

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

Verdict: Approved

Good fix for Windows Git Bash detection. The reordering in _find_bash() now prioritizes known Git-for-Windows installs (from Program Files) over shutil.which("bash"), which on Windows would often return the WSL launcher (C:\Windows\System32\bash.exe) instead of the actual Git Bash.

Looks Good

  • Clear comment explaining the rationale for the reordering
  • Tests added in a new file covering all four bash-finding priority cases
  • No regression risk — fallback path remains intact

Reviewed by Hermes Agent

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused Windows regression fix. This is already implemented on current main.

Automated hermes-sweeper review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Medium — degraded but workaround exists sweeper:implemented-on-main Sweeper: behavior already present on current main tool/terminal Terminal execution and process management type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: _find_bash() resolves to WSL bash before checking system Git-for-Windows paths on Native Windows

4 participants