Repository navigation
v2.33.1
What's new
A follow-up patch to discovered-skill command registration (#592): disabled_commands now actually suppresses discovered-skill commands, a single-read fix removes a redundant file read, and a CodeQL-flagged TOCTOU race in the same code path is closed.
Bug Fixes
Discovered skills register as slash commands under their bare name, but collectDiscoveredSkillsAsCommands was ignoring the disabled_commands field, so there was no way to suppress a single discovered skill's command short of turning off the whole feature. The fix filters discovered-command emission by disabled_commands — the free-form field that governs command names — while leaving the stricter disabled_skills bundled-name enum untouched. The configuration guide now documents the split: disabled_skills governs bundled skills, disabled_commands governs discovered-skill commands.
The same follow-up also closed a file-system race CodeQL flagged (js/file-system-race) in the discovered-skill file read: a statSync check-then-readFileSync pattern left a time-of-check/time-of-use window. The pre-check is dropped in favor of reading the file directly — a directory throws EISDIR and a missing path throws ENOENT, both already handled by the existing catch, so the same skip behavior holds with one fewer syscall and no race window.
As a performance side effect, command-only discovered skills (e.g., skills with model invocation disabled) previously read their SKILL.md twice — once via extractFrontmatter during discovery, which discarded the body, and again via readFileSync in the inline command path. extractFrontmatterFromContent was split out of extractFrontmatter so the file is read once in toDiscoveredSkill, with the body carried on DiscoveredSkill for the inline command path to reuse.