Summary
new URL(import.meta.url).pathname on Windows returns a URL-encoded path with a leading / that doesn't round-trip back to a usable filesystem path. When the plugin then calls path.join(PLUGIN_DIR, ".metaclaw"), the resulting venv path looks like \C:\Users\Evo%20X2%20-%20NoopAI\.openclaw\extensions\metaclaw-openclaw\.metaclaw, and the underlying syscall fails with [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'C:\C:'.
Reproduction
- Windows 10/11
- User profile (or any ancestor path component) contains spaces — e.g.
Evo X2 - NoopAI
- Install the plugin, start the gateway
- Plugin doctor reports:
metaclaw-openclaw: creating venv at \C:\Users\Evo%20X2%20-%20NoopAI\.openclaw\extensions\metaclaw-openclaw\.metaclaw using python3…
metaclaw-openclaw: venv creation failed. stderr:
Error: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'C:\C:'
Affected line — index.ts:13
const PLUGIN_DIR = path.dirname(new URL(import.meta.url).pathname);
Fix — use fileURLToPath from node:url, which decodes percent-encoding and strips the leading / correctly:
import { fileURLToPath } from "node:url";
const PLUGIN_DIR = path.dirname(fileURLToPath(import.meta.url));
Verified locally on Windows 11 — venv creates cleanly with the patch.
Summary
new URL(import.meta.url).pathnameon Windows returns a URL-encoded path with a leading/that doesn't round-trip back to a usable filesystem path. When the plugin then callspath.join(PLUGIN_DIR, ".metaclaw"), the resulting venv path looks like\C:\Users\Evo%20X2%20-%20NoopAI\.openclaw\extensions\metaclaw-openclaw\.metaclaw, and the underlying syscall fails with[WinError 123] The filename, directory name, or volume label syntax is incorrect: 'C:\C:'.Reproduction
Evo X2 - NoopAIAffected line —
index.ts:13Fix — use
fileURLToPathfromnode:url, which decodes percent-encoding and strips the leading/correctly:Verified locally on Windows 11 — venv creates cleanly with the patch.