Skip to content

[Bug] Windows skill path compaction mixes separators and causes wrong read paths #52022

@lost9999

Description

@lost9999

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

  1. Install OpenClaw on Windows.
  2. Install at least one plugin skill under ~/.openclaw/extensions/... and keep at least one core skill under global npm OpenClaw install.
  3. Trigger an agent run that consults <available_skills> and tries to read a suggested skill file.
  4. 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 doctor and 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions