Skip to content

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

Open

Description

@victor-commit

Summary

The skill hot-reload delete handler derives the removal key from the directory name, but skills are stored under an id generated from the SKILL.toml name. When those differ, deletion silently misses and the stale skill stays loaded.

Location

src/cortex-skills/src/manager.rs:371-382 (WatchEvent::Deleted handler), at commit 7954d021 (current main).

On delete it computes skill_id = skill_dir.file_name().to_str().to_lowercase() and calls skills.remove(&skill_id). But skills are inserted by skill.id (manager.rs:159,219,356), where id is generated from the SKILL.toml name (parser.rs:139-145: lowercase, spaces→hyphens, non-alphanumeric stripped). The directory name need not equal that id.

Reproduction

A skill in directory code_review/ with SKILL.toml name = "Code Review" is stored under id code-review. Deleting its SKILL.toml triggers remove("code_review"), which does not match "code-review".

Expected: the skill is removed from the in-memory registry.
Actual: the stale skill remains in the DashMap (hot-removal silently fails).

Suggested fix

Track a dir → id mapping at load time and remove by the stored id, or on delete scan skill values for the one whose source directory matches path.parent() and remove by its actual id.

Activity

  1. added a commit that references this issue on Oct 12, 2026
    a145e3d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions