fix(cron): skip Windows WSL launcher stub when resolving bash for .sh jobs - #60617
fix(cron): skip Windows WSL launcher stub when resolving bash for .sh jobs#60617paulhopcraft-dot wants to merge 2 commits into
Conversation
…ire) New MemoryProvider plugin so Hermes writes each turn to and reads context from Paul's unified-memory service (http://localhost:18790, loopback, unauthenticated hook+relevant endpoints — no bearer). - sync_turn -> POST /api/memory/hooks/after-reply (background daemon thread, channel="hermes") - prefetch -> GET /api/memory/relevant (bounded 2.5s, returns "" on any error) - get_tool_schemas -> [] (context-only); 15 tests pass. Activated via memory.provider: unified_memory in ~/.hermes/config.yaml. KNOWN ISSUES found during live verify (tracked separately): 1. UM /search + /relevant return 0 (ctx.searchEngine null, fts5_active:false) -> read path delivers nothing until UM is fixed. 2. after-reply envelope nests sessionKey/channel under hookCtx, but UM's extractHookCtx reads them top-level -> writes bucket to "session-default" instead of channel="hermes". Same latent bug affects the CC hook. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… jobs
shutil.which("bash") can resolve to the non-functional WSL launcher at
%SystemRoot%\System32\bash.exe (present on stock Windows even without a
WSL distro installed) instead of a real Git Bash further down PATH.
Background-service contexts (the gateway's Scheduled Task) hit this
because System32 typically precedes user-installed dirs on PATH, so
.sh cron jobs failed with "Windows Subsystem for Linux has no
installed distributions" instead of running.
_resolve_bash() now walks PATH itself and skips both known stub dirs
(System32 and the WindowsApps app-execution alias), falling through to
a real bash further down PATH.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Related to a saturated cluster of OPEN competing PRs fixing Windows cron This PR is the narrow cron-only variant: it adds Note: this PR also bundles an unrelated new memory plugin ( |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for isolating the Windows cron failure. The premise is still present on current main: cron/scheduler.py:2082 resolves bash through shutil.which("bash").
Problems
plugins/memory/unified_memory/__init__.py:216registers a new in-tree memory provider.AGENTS.md:786-795requires new memory backends to ship as standalone plugins, so this unrelated change must be removed from the PR.- The added cron-only resolver bypasses the established Windows precedence in
tools/environments/local.py:524-557and the documented contract atwebsite/docs/user-guide/windows-native.md:108-116: configuredHERMES_GIT_BASH_PATH, Hermes PortableGit, and known Git installs must win before PATH. It also leaves the same WSL-stub class in the shared resolver's PATH fallback attools/environments/local.py:559-561.
Suggested changes
- Split out the memory-provider work as a standalone plugin.
- Put the WSL-launcher filtering into shared
_find_bash()and route cron through it, with regression coverage for configured/PortableGit precedence.
Automated hermes-sweeper review.
|
|
||
| def register(ctx) -> None: | ||
| """Register unified-memory as a memory provider plugin.""" | ||
| ctx.register_memory_provider(UnifiedMemoryProvider()) |
There was a problem hiding this comment.
This registers a new provider under plugins/memory/, but AGENTS.md:786-795 closes the in-tree memory-provider set. Please remove this unrelated provider from the cron PR and publish it as a standalone plugin.
|
Reconciliation (2026-08-03): the WSL-launcher-stub skip this PR proposes is handled by the canonical #77532 ( |
Summary
.sh/.bashcron scripts on Windows could resolvebashto the non-functional WSL launcher stub at%SystemRoot%\System32\bash.exeinstead of a real Git Bash, becauseshutil.which("bash")returns whichever comes first on PATH. That stub exists on stock Windows even when no WSL distro is installed.System32typically precedes user-installed directories like Git'sbinon PATH there. The resulting failure looked like:Script exited with code 1 ... Windows Subsystem for Linux has no installed distributions._resolve_bash()now walks PATH itself on Windows and skips both known non-functional stub directories (System32and theWindowsAppsapp-execution alias), falling through to a real bash further down PATH. Non-Windows behavior (shutil.which//bin/bashfallback) is unchanged.Test plan
tests/tools/test_windows_native_support.py::TestCronSchedulerBashResolutioncases: skips System32 stub, skips WindowsApps alias, returnsNonewhen only stubs are present, POSIX platforms unaffected.pytest tests/cron/ tests/tools/test_windows_native_support.py— 421 passed; the 13 failures present are pre-existing onmaintoo (POSIX-only assumptions: file permission bits,signal.SIGKILL, a Linux-onlyis_windows()test) — confirmed via baseline comparison, unrelated to this change.PATH=System32;<git-bin>(the exact ordering that triggers the bug) — now resolves to the real Git Bash instead of the stub.ruff checkclean on both changed files.🤖 Generated with Claude Code