fix(cron): prefer Git Bash and POSIX paths on Windows (#46332) - #46364
fix(cron): prefer Git Bash and POSIX paths on Windows (#46332)#46364Tranquil-Flow wants to merge 1 commit into
Conversation
ae72e81 to
76018f2
Compare
|
Verification — reviewed diff, no issues found. Checked:
Clean fix for issue #46332. |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for addressing a real native-Windows cron failure. Current main still invokes shell scripts as [_bash, str(path)] after shutil.which("bash") (cron/scheduler.py:2077-2092), so both the WSL-first and backslash-path premises remain valid.
Problems
- The new resolver at
cron/scheduler.py:914-920only checksGit\\usr\\bin\\bash.exe. It bypasses the established resolution contract intools/environments/local.py:561-598:HERMES_GIT_BASH_PATH, Hermes-managed PortableGit/MinGit, and standard Git-for-WindowsGit\\bin\\bash.exeall precede PATH. A normalGit\\binor Hermes PortableGit install can therefore still fall through to WSL bash.
Suggested changes
- Reuse or extract the existing
_find_bash()resolution logic, while retaining the Windows-onlypath.as_posix()argv conversion. - Add resolver tests for the custom override, Hermes portable install, and standard
Git\\binbefore asserting the PATH fallback.
Automated hermes-sweeper review.
| On non-Windows platforms ``shutil.which("bash")`` is sufficient. | ||
| """ | ||
| if sys.platform == "win32": | ||
| for _dir in _GIT_BASH_DIRS: |
There was a problem hiding this comment.
This duplicated resolver skips the supported HERMES_GIT_BASH_PATH, Hermes PortableGit locations, and standard Git\\bin\\bash.exe layout implemented by tools/environments/local.py:_find_bash. Reuse or extract that resolution chain; otherwise normal Git/PortableGit installs can still fall through to WSL via PATH.
…NousResearch#46364) Sweeper feedback: replace hardcoded Git\usr\bin resolver with established _find_bash() from tools/environments.local which checks HERMES_GIT_BASH_PATH, PATH, and Git\bin locations. Updated tests to cover custom override, standard Git\bin, and RuntimeError fallback.
|
Reconciliation (2026-08-03): thank you for the diagnosis and the two-layer structure — the Layer 1 (resolver) / Layer 2 (path form) framing is reused in the canonical. Current state: this branch is now |
76018f2 to
32af9d0
Compare
|
Verified locally on Windows 10 + desktop gateway process — the approach in this PR is correct and matches what I needed to fix the same bug (#43073). Preferring Git Bash over WSL's One thing worth double-checking: on current Local verification data (against
Thanks for the PR — happy to help with anything else needed to get it merged. |
Fixes #46332.
Summary
bash.exewhen running.sh/.bashcron scripts on native Windows.Why
Issue #46332 reports two separate Windows-only root causes:
shutil.which("bash")may resolve to WSL bash before Git Bash; WSL bash cannot execute Windows paths even when they use forward slashes.C:\Users\...intoC:Users....This PR covers both layers. Existing open PRs I found (#23405, #23489, #43076, #44350) only address the POSIX/forward-slash path layer and do not resolve the WSL bash preference layer.
Verification
/Users/evinova-self/.hermes/hermes-agent/venv/bin/python3 -m pytest tests/cron/test_cron_no_agent.py -v -o "addopts=" --tb=short26 passed, 1 warning in 0.48sgit rev-list --left-right --count upstream/main...HEAD→0 1Notes
Auto-published by Moonsong via Path B automated pipeline.