-
-
Notifications
You must be signed in to change notification settings - Fork 69.5k
[Bug] Windows skill path compaction mixes separators and causes wrong read paths #52022
Description
Windows skill path compaction emits mixed separators and leads to wrong read paths
Observed on 2026-03-22 with:
openclaw 2026.3.13@larksuite/openclaw-lark 2026.3.17- Windows 11
Summary
On Windows, OpenClaw compacts skill paths by replacing the user home prefix with ~/, but it leaves the remaining path with backslashes.
That produces prompt-facing skill locations like:
~/AppData\Roaming\npm\node_modules\openclaw\skills\healthcheck\SKILL.md
~/.openclaw\extensions\openclaw-lark\skills\feishu-troubleshoot\SKILL.md
These hybrid paths appear in <available_skills> and are easy for the model to misread. In practice, the model then guesses non-existent absolute paths and tool reads fail with ENOENT.
Actual behavior
Prompt-facing skill locations can be mixed-separator paths. Example failures observed in one session:
read failed: ENOENT: no such file or directory, access 'C:\Users\lost\.openclaw\skills\healthcheck\SKILL.md'
read failed: ENOENT: no such file or directory, access 'C:\Users\lost\AppData\Roaming\npm\node_modules\openclaw\extensions\openclaw-lark\skills\feishu-troubleshoot\SKILL.md'
read failed: ENOENT: no such file or directory, access 'C:\Users\lost\AppData\Roaming\npm\node_modules\openclaw\extensions\openclaw-lark\skills\healthcheck\SKILL.md'
The real files existed, but at:
C:\Users\lost\AppData\Roaming\npm\node_modules\openclaw\skills\healthcheck\SKILL.md
C:\Users\lost\.openclaw\extensions\openclaw-lark\skills\feishu-troubleshoot\SKILL.md
So the problem was not a missing skill. It was the model inferring the wrong absolute path from the mixed-separator prompt path.
Expected behavior
Prompt-facing skill locations should use a single path style on Windows after ~/ compaction, for example:
~/AppData/Roaming/npm/node_modules/openclaw/skills/healthcheck/SKILL.md
~/.openclaw/extensions/openclaw-lark/skills/feishu-troubleshoot/SKILL.md
Likely root cause
Current implementation in bundled compactSkillPaths() logic is effectively:
function compactSkillPaths(skills) {
const home = os.homedir();
if (!home) return skills;
const prefix = home.endsWith(path.sep) ? home : home + path.sep;
return skills.map((s) => ({
...s,
filePath: s.filePath.startsWith(prefix) ? "~/" + s.filePath.slice(prefix.length) : s.filePath
}));
}On Windows, that leaves the remainder untouched, so the result becomes ~/... plus backslashes.
Proposed fix
Normalize prompt-facing paths after compaction on Windows:
function compactSkillPaths(skills) {
const home = os.homedir();
if (!home) return skills;
const prefix = home.endsWith(path.sep) ? home : home + path.sep;
const normalizePromptPath = (value) =>
process.platform === "win32" ? value.replace(/\\/g, "/") : value;
return skills.map((s) => ({
...s,
filePath: s.filePath.startsWith(prefix)
? normalizePromptPath(`~/${s.filePath.slice(prefix.length)}`)
: normalizePromptPath(s.filePath)
}));
}Reproduction
- Install OpenClaw on Windows.
- Install at least one plugin skill under
~/.openclaw/extensions/...and keep at least one core skill under globalnpmOpenClaw install. - Trigger an agent run that consults
<available_skills>and tries toreada suggested skill file. - Inspect the session prompt or logs.
You may see mixed-separator skill locations in the prompt and follow-up ENOENT reads against guessed wrong absolute paths.
Notes
openclaw doctorand plugin diagnostics can still pass, because the files do exist.- This looks like a Windows prompt-formatting issue in OpenClaw core, not a plugin installation problem.