From 921bfbbe3c25cb0a2bd0dafd795b1baee7070726 Mon Sep 17 00:00:00 2001 From: Ivan Date: Fri, 3 Apr 2026 23:06:55 +0300 Subject: [PATCH] fix(cli): parse where output on Windows to prefer .cmd/.exe wrappers The locateCommand function returned the bare command name instead of parsing the where output. On Windows, npm global installs create both a Unix shell script (no extension) and a .cmd wrapper. where returns both, and the bare name resolves to the Unix script first, causing healthcheck failures for OpenClaw and OpenCode. Fix: parse where output and prefer paths with Windows executable extensions (.cmd, .exe, .bat, .com). Related: #935, #863 --- src/shared/services/cliRuntime.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/shared/services/cliRuntime.ts b/src/shared/services/cliRuntime.ts index 86da91a085..5cb2cda0f3 100644 --- a/src/shared/services/cliRuntime.ts +++ b/src/shared/services/cliRuntime.ts @@ -537,7 +537,16 @@ const locateCommand = async (command: string, env: Record l.trim()) + .filter(Boolean); + const winExt = /\.(cmd|exe|bat|com)$/i; + const preferred = lines.find((l) => winExt.test(l)) || lines[0]; + return { installed: true, commandPath: preferred, reason: null }; } return { installed: false, commandPath: null, reason: "not_found" }; }