fix(windows): add Scoop, Chocolatey, and MSYS2 Git Bash paths - #38092
fix(windows): add Scoop, Chocolatey, and MSYS2 Git Bash paths#38092sc5464988 wants to merge 2 commits into
Conversation
On Windows, _find_bash() only checked PortableGit, winget/system Git, and Program Files. Users who installed Git via Scoop, Chocolatey, or MSYS2 couldn't find bash.exe and got a "Git Bash not found" error even though bash was installed.
teknium1
left a comment
There was a problem hiding this comment.
Thanks for extending the Windows Git Bash discovery list. The runtime premise still holds on current main: tools/environments/local.py:588-598 has only the standard Git-for-Windows locations before its PATH fallback.
Problems
apps/desktop/electron/main.ts:1789-1824says Desktop checks the same locations as runtime_find_bash(), but its candidate list lacks all three proposed paths. Updating only Python would make desktop prerequisite detection disagree with runtime behavior.scripts/install.ps1:868-917independently resolves and persistsHERMES_GIT_BASH_PATH, but likewise lacks these explicit candidates.- There is no direct Windows candidate-selection regression test;
tests/tools/test_find_shell.py:106-116only verifies a generic POSIX_find_bash()result.
Suggested changes
- Keep the existing precedence and synchronize the desktop and installer candidate lists with the runtime list.
- Add mocked Windows tests for each package-manager location and PATH-fallback ordering.
This is an automated hermes-sweeper review.
| os.path.join(os.environ.get("ProgramFiles(x86)", r"C:\Program Files (x86)"), "Git", "bin", "bash.exe"), | ||
| os.path.join(_local_appdata, "Programs", "Git", "bin", "bash.exe"), | ||
| # Scoop | ||
| os.path.join(os.environ.get("USERPROFILE", ""), "scoop", "apps", "git", "current", "usr", "bin", "bash.exe"), |
There was a problem hiding this comment.
Please synchronize this candidate with the independently maintained Desktop preflight list in apps/desktop/electron/main.ts:1805-1824 and installer resolver in scripts/install.ps1:875-917; Desktop currently states that its list matches runtime _find_bash().
…nstaller, add tests PR NousResearch#38092 added three package-manager Git Bash paths to _find_bash() but did not mirror them in the Desktop preflight (main.cjs:findGitBash) or the installer (install.ps1:Set-GitBashEnvVar), which both maintain independent but identical candidate lists claiming to match runtime behavior. This commit: - Adds Scoop, Chocolatey, and MSYS2 candidates to findGitBash (main.cjs) - Adds the same three candidates to Set-GitBashEnvVar (install.ps1) - Adds test_local_env_find_bash.py with 14 mocked Windows tests covering every package-manager location, PATH-fallback ordering, and the HERMES_GIT_BASH_PATH escape hatch Review: NousResearch#38092 (review) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Done — synchronized the three new paths into @teknium1 ready for re-review. |
Hi, I'm linglingwu, a Windows user from China.
One night I realized Hermes Agent only runs inside WSL on Windows. I had a crazy idea — build a version that runs
natively in PowerShell, no WSL needed.
Pulled an all-nighter and got it working. Thought I was the first person to do it. Then I checked and realized… the
official project already has native Windows support.
Didn't want the effort to go to waste, so I dug into the official implementation and found that _find_bash() was
missing a few common Git install paths. This PR adds them.
Changes
Added three Git Bash paths to _find_bash() in tools/environments/local.py:
Fixes part of #7835. Users who installed Git via these package managers would get "Git Bash not found" even though
bash was installed.
Purely additive — no existing behavior is affected. Tested on Windows 11.
Thanks for building an amazing agent!