You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Default command loader scans wrong dirs (command/Cortex vs commands/cortex); imported global commands never load #416
CommandLoader::new() / default() and sync::default_search_dirs() default to command directories that don't match the canonical ones used everywhere else in the crate, so commands imported/written to the standard location are never found by the default loader on case-sensitive filesystems.
Location
src/cortex-commands/src/loader.rs:50 and :54 (duplicated at :248 and :252), at commit 7954d021 (current main).
But the canonical dirs everywhere else are plural / lowercase:
.cortex/commands and cortex/commands — manager.rs:110,118,166,170; import.rs:344,348; builtin/commands_cmd.rs.
The loader's own doc comment (loader.rs:44-45) even says lowercase ~/.config/cortex/command/, contradicting the code's "Cortex".
Reproduction
Import/place a global command at ~/.config/cortex/commands/foo.md (where CommandManager::import_from / default_command_target write).
Call CommandRegistry::load_default() (registry.rs:31-35, uses CommandLoader::new()) or sync::load_all() (builtin/commands_cmd.rs:66).
Expected:foo is loaded. Actual: not loaded — the loader scans .cortex/command / Cortex/command instead.
Suggested fix
Change both default-dir sites (and the :248/:252 duplicate) to .cortex/commands and config_dir.join("cortex").join("commands"), matching the rest of the crate.
Activity
fix(commands): load from the canonical command directories
fix(commands): load from the canonical command directories