Skip to content

/reset on Windows fails: spawn openclaw ENOENT and invalid file:// URLs from Unix paths #648

@libozhang03-cyber

Description

@libozhang03-cyber

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

  1. spawn("openclaw", ...) without shell on Windows ? ENOENT
  2. 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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions