Skip to content

fix: load skills from symlinked directories (#2104)#2137

Merged
esengine merged 1 commit into
esengine:mainfrom
zhangyapu1:fix/skill-symlink-clean
May 28, 2026
Merged

fix: load skills from symlinked directories (#2104)#2137
esengine merged 1 commit into
esengine:mainfrom
zhangyapu1:fix/skill-symlink-clean

Conversation

@zhangyapu1

Copy link
Copy Markdown

Problem

SkillStore.readEntry() uses entry.isDirectory() to detect skill directories, but Node.js Dirent.isDirectory() returns false for symlinks. This causes symlinked skill directories to be silently skipped.

Fix

Added isSymbolicLink() check with statSync fallback:

  • If a Dirent is a symlink, statSync() resolves it and checks if the target is a directory
  • Broken symlinks are safely skipped (catch returns false)
  • No behavior change for regular directories or files

Closes #2104

SkillStore.readEntry() used entry.isDirectory() to detect skill
directories, but Node.js Dirent.isDirectory() returns false for
symlinks. This caused symlinked skill directories to be silently
skipped with no error or warning.

Added isSymbolicLink() check with statSync fallback to resolve
symlinks and verify the target is a directory. Broken symlinks
are safely skipped without throwing.

Closes esengine#2104
@zhangyapu1 zhangyapu1 force-pushed the fix/skill-symlink-clean branch from 1ecac42 to 179adce Compare May 28, 2026 07:39
@esengine esengine merged commit 55a8f62 into esengine:main May 28, 2026
4 checks passed
esengine added a commit that referenced this pull request May 29, 2026
…dmin) (#2239)

The two symlinked-skill tests added in #2137 — "loads skills from
symlinked directories (#2104)" and "skips broken symlinks gracefully" —
call symlinkSync with no Windows guard, so `npm run verify` fails with
EPERM for contributors on Windows that lack Developer Mode / admin. CI's
Windows runner has the privilege so it slipped through. Add
`.skipIf(process.platform === "win32")`, matching the #2124 symlink tests
already in this file.

Co-authored-by: yhh <yhh@yhhdeMac-mini.local>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SkillStore.readEntry ignores symlinked directories

2 participants