Skip to content

Commit b2dac58

Browse files
committed
fix(skills): use original path for symlinked skills instead of skipping
resolveContainedSkillPath() skipped skills when their realpath resolved outside the configured root (e.g. pnpm symlinks, macOS /var -> /private/var). This caused valid skills to be silently dropped. Now falls back to the original (unresolved) path when it is inside the root, logging a warning instead of skipping entirely.
1 parent 1ccb9ae commit b2dac58

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/agents/skills/workspace.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,15 @@ function resolveContainedSkillPath(params: {
211211
if (isPathInside(params.rootRealPath, candidateRealPath)) {
212212
return candidateRealPath;
213213
}
214+
if (isPathInside(params.rootDir, path.resolve(params.candidatePath))) {
215+
skillsLogger.warn("Skill path resolves outside root via symlink; using original path.", {
216+
source: params.source,
217+
rootDir: params.rootDir,
218+
path: path.resolve(params.candidatePath),
219+
realPath: candidateRealPath,
220+
});
221+
return path.resolve(params.candidatePath);
222+
}
214223
warnEscapedSkillPath({
215224
source: params.source,
216225
rootDir: params.rootDir,

0 commit comments

Comments
 (0)