Bug Description
On Windows, /reset triggers the memory-reflection pipeline which fails with two distinct errors:
Error 1: spawn openclaw ENOENT
unReflectionViaCli() calls spawn("openclaw", args, ...) on Windows. Since openclaw is a .cmd/.bat file (not a bare executable), Windows can't find it without shell resolution ? ENOENT.
Error 2: Invalid ile:// URLs from Unix-style fallback paths
getExtensionApiImportSpecifiers() adds Unix absolute paths as fallback import specifiers:
- /usr/lib/node_modules/openclaw/dist/extensionAPI.js
- /usr/local/lib/node_modules/openclaw/dist/extensionAPI.js
On Windows, these get passed through pathToFileURL("/usr/lib/...") which produces invalid URLs like ile:///C:/usr/lib/..., causing import failures.
Root Cause
- spawn("openclaw", ...) without shell on Windows ? ENOENT
- Unix-only paths in getExtensionApiImportSpecifiers() generate invalid ile:// URLs on Windows
Proposed Fix
unReflectionViaCli():
\\ ypescript
const isWindows = process.platform === "win32";
const resolvedCliBin = isWindows ? "cmd" : "openclaw";
const spawnArgs = isWindows ? ["/c", "openclaw", ...args] : args;
const child = spawn(resolvedCliBin, spawnArgs, { ... });
\\
\getExtensionApiImportSpecifiers():
- Guard Unix-only paths with if (!isWindows) to avoid invalid file:// URLs on Windows
- Add Windows-specific fallback paths for npm global installs and portable/node bundled installs
Environment
- OS: Windows (observed on Windows_NT 10.0.22631)
- Node.js: any version
- OpenClaw: 2026.4.x
- Plugin: memory-lancedb-pro
Bug Description
On Windows, /reset triggers the memory-reflection pipeline which fails with two distinct errors:
Error 1: spawn openclaw ENOENT
unReflectionViaCli() calls spawn("openclaw", args, ...) on Windows. Since openclaw is a .cmd/.bat file (not a bare executable), Windows can't find it without shell resolution ? ENOENT.
Error 2: Invalid ile:// URLs from Unix-style fallback paths
getExtensionApiImportSpecifiers() adds Unix absolute paths as fallback import specifiers:
On Windows, these get passed through pathToFileURL("/usr/lib/...") which produces invalid URLs like ile:///C:/usr/lib/..., causing import failures.
Root Cause
Proposed Fix
unReflectionViaCli():
\\ ypescript
const isWindows = process.platform === "win32";
const resolvedCliBin = isWindows ? "cmd" : "openclaw";
const spawnArgs = isWindows ? ["/c", "openclaw", ...args] : args;
const child = spawn(resolvedCliBin, spawnArgs, { ... });
\\
\getExtensionApiImportSpecifiers():
Environment