Skip to content

fix: improve symlink handling in skills directory#5576

Merged
kevinvandijk merged 4 commits intoKilo-Org:mainfrom
Patel230:fix/symlink-skills-directory
Feb 13, 2026
Merged

fix: improve symlink handling in skills directory#5576
kevinvandijk merged 4 commits intoKilo-Org:mainfrom
Patel230:fix/symlink-skills-directory

Conversation

@Patel230
Copy link
Contributor

@Patel230 Patel230 commented Feb 1, 2026

Summary

Fixes #5408

Users reported that symlinked skills directories (.kilocode/skills -> another location) were inconsistently recognized - sometimes working, sometimes failing with ENOENT errors.

Root Cause

The error handling in fileExists, directoryExists, and scanSkillsDirectory didn't account for all symlink-related error conditions:

  • ELOOP: Too many symbolic links (circular symlinks)
  • ENOTCONN: Network drive not connected (for symlinks to network paths)

When these errors occurred, they would bubble up and cause skill discovery to fail.

Changes

1. src/services/roo-config/index.ts

  • Added ELOOP and ENOTCONN to handled error codes in fileExists() and directoryExists()
  • Updated comments to explain symlink-related error handling

2. src/services/skills/SkillsManager.ts

  • Improved error handling in scanSkillsDirectory() to gracefully handle:
    • ENOENT: Broken symlinks or missing targets
    • ELOOP: Circular symlinks
    • ENOTCONN: Unavailable network drives
  • Added error logging for unexpected errors to help with debugging

Testing

  • All 18 SkillsManager tests pass
  • All 40 roo-config tests pass
  • All 18 lint checks pass

Before vs After

Scenario Before After
Symlink to network drive (disconnected) ❌ Error ✅ Gracefully ignored
Circular symlinks ❌ Error ✅ Gracefully ignored
Broken symlinks ❌ Error ✅ Gracefully ignored
Valid symlinks ✅ Works ✅ Works

@changeset-bot
Copy link

changeset-bot bot commented Feb 1, 2026

🦋 Changeset detected

Latest commit: b3c005b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
kilo-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Improve error handling for symlink-related edge cases in skills discovery:

- Add ELOOP (circular symlinks) and ENOTCONN (network drives) error handling
- Handle broken symlinks gracefully in scanSkillsDirectory
- Add better error logging for unexpected errors

This fixes inconsistent behavior when .kilocode/skills is a symlink,
especially for network drives or when symlink targets are temporarily
unavailable.

Fixes Kilo-Org#5408
@Patel230 Patel230 force-pushed the fix/symlink-skills-directory branch from a8b8a3a to 40b4c98 Compare February 1, 2026 06:46
Copy link
Collaborator

@kevinvandijk kevinvandijk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Patel230!

@kevinvandijk kevinvandijk merged commit 1deec7b into Kilo-Org:main Feb 13, 2026
12 checks passed
@Patel230
Copy link
Contributor Author

Thanks @Patel230!

Thank you so much @kevinvandijk

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.

Kilocode Inconsistent Recognition of Symlinked skills Directory

2 participants