Skip to content

plugin-skills stale generated symlink is not replaced when target disappears #85925

Description

@shakkernerd

OpenClaw can repeatedly warn while publishing plugin skills if an existing generated plugin skill symlink points to a target that no longer exists:

[skills] failed to create plugin skill symlink ".../.openclaw/plugin-skills/browser-automation" → ".../openclaw/dist/extensions/browser/skills/browser-automation": Error: EEXIST: file already exists, symlink '.../openclaw/dist/extensions/browser/skills/browser-automation' -> '.../.openclaw/plugin-skills/browser-automation'

Reproduced state:

.openclaw/plugin-skills/browser-automation
-> /old/install/path/openclaw/dist/extensions/browser/skills/browser-automation

Then the old install path is removed, and OpenClaw later tries to publish the current plugin skill:

.openclaw/plugin-skills/browser-automation
-> /new/install/path/openclaw/dist/extensions/browser/skills/browser-automation

The publish step fails with EEXIST because the stale generated symlink still exists.

Expected behavior:

  • Generated plugin skill links should be idempotent.
  • If an existing generated plugin skill symlink points to a different target, OpenClaw should replace it.
  • If the existing generated symlink is broken because the old target disappeared, OpenClaw should still remove it and create the current link.
  • Users should not need to manually clean ~/.openclaw/plugin-skills.

Observed on:

OpenClaw 2026.5.22 (a374c3a)

Relevant history:

1df2ac442a fix #77296: Plugin manifest skills field not published to agent skill discovery paths
30cfcf21b7 fix(skills): replace generated plugin skill directories

Likely fix:

Use symlink-aware cleanup for generated plugin skill entries: lstatSync to classify the entry, unlinkSync for symlinks, and directory removal only for generated directory/junction cases. Add regression coverage for a generated plugin skill symlink whose target no longer exists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦐 gold shrimpDecent issue quality, but reproduction details are still incomplete.maintainerMaintainer-authored PR

    Type

    No type

    Fields

    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