Skip to content

fix(skills): hot-remove deleted skills by id, not directory name (#417) - #419

Open
ALDL (victor-commit) wants to merge 1 commit into
CortexLM:mainfrom
victor-commit:fix/skill-hot-reload-delete
Open

ALDL (victor-commit) wants to merge 1 commit into
CortexLM:mainfrom
victor-commit:fix/skill-hot-reload-delete

Conversation

@victor-commit

@victor-commit ALDL (victor-commit) commented Oct 12, 2026 •

Copy link
Copy Markdown

Deleting a skill's SKILL.toml doesn't reliably unload the skill.

The WatchEvent::Deleted handler removes by the lowercased directory name, but skills are stored under an id derived from the name field in SKILL.toml (lowercased, spaces → hyphens, non-alphanumerics stripped — see parser.rs). So a skill in code_review/ with name = "Code Review" is stored as code-review, while delete tries to remove code_review and misses — the stale skill stays in the map.

Each Skill already keeps its source_path (the skill directory), so this switches the delete to match on that via retain, removing the entry by its real id regardless of the folder name.

I checked this against the data model (the insert sites, source_path, and the id generation in parser.rs); haven't compiled it locally.

Fixes #417

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 54 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cc63961e-e1b1-4bf0-b4dd-da0bcd137fcb

📥 Commits

Reviewing files that changed from the base of the PR and between 56db971 and a145e3d.


📒 Files selected for processing (1)
  • src/cortex-skills/src/manager.rs

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5b2623e0-832b-4b48-88f2-0e01210d7d6c

📥 Commits

Reviewing files that changed from the base of the PR and between 7954d02 and 56db971.


📒 Files selected for processing (1)
  • src/cortex-skills/src/manager.rs

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.



📝 Walkthrough
📝 Walkthrough
📝 Walkthrough

Walkthrough

The skill hot-reload deletion handler now removes every loaded skill whose source path matches the deleted directory. It logs the ID of each removed skill.

Changes

Skill deletion cleanup

Layer / File(s) Summary
Match and remove loaded skills
src/cortex-skills/src/manager.rs
The deletion handler matches loaded skills by source path, removes each match, and logs its ID.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Low


Merge Risk: ⚪ Minimal · up to 56db9

No actionable deletion-path issue remains; the change is ready to merge after normal checks.

Pre-merge checks | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check Passed The change meets issue #417. The Deleted handler obtains the deleted skill directory from path.parent(). It uses DashMap::retain to compare that directory with each skill's stored source_path.…
Out of Scope Changes check Passed The reviewed change is limited to the WatchEvent::Deleted hot-reload removal logic and related removal logging. The change directly supports issue #417. No unrelated behavior or files are identified…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the hot-reload fix for deleted skills and identifies the mismatch between skill IDs and directory names.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The WatchEvent::Deleted handler removed skills using the lowercased
directory name, but skills are stored under an id derived from the
SKILL.toml `name` (lowercased, spaces->hyphens, non-alphanumeric
stripped). When they differ the removal missed and the stale skill
stayed in the DashMap. Match on the stored `source_path` instead.

Fixes CortexLM#417
@victor-commit
ALDL (victor-commit) force-pushed the fix/skill-hot-reload-delete branch from 56db971 to a145e3d Compare October 12, 2026 10:02
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.

[BUG] Skill hot-reload delete keys off directory name instead of skill id, leaving stale skills loaded

2 participants