Skip to content

fix(skills): build_registry() does not include managed_dir — bundled skills not matched when skills.paths is customized #2259

@bug-ops

Description

@bug-ops

Summary

build_registry() provisions bundled skills to managed_dir (e.g., ~/.config/zeph/skills/) but then loads the registry only from self.config.skills.paths — never including managed_dir. As a result, bundled skills (browser, os-automation, etc.) are installed on disk but never enter the SkillRegistry and cannot be matched.

Root Cause

crates/zeph-core/src/bootstrap/mod.rs lines 355–357:

// build_registry() — BUG: does not include managed_dir
let skill_paths: Vec<PathBuf> =
    self.config.skills.paths.iter().map(PathBuf::from).collect();
let registry = SkillRegistry::load(&skill_paths);

Correct logic already exists in skill_paths() (lines 375–381) which adds managed_dir when not present, but build_registry() does not call it.

Impact

  • Any user who overrides skills.paths in config (e.g., testing, custom skill dirs) loses all bundled skill matching silently
  • Default config is unaffected because default_skills_dir() IS managed_dir — default users have managed_dir in their skills.paths by coincidence
  • Confirmed via live test: skill matcher initialized for 1 skill(s) with paths = [".local/testing/skills"] despite browser + os-automation provisioned to ~/.config/zeph/skills/

Reproduction

  1. Set skills.paths = ["/some/custom/path"] in config (any path other than the managed dir)
  2. Start agent — bundled skills provision OK (no errors)
  3. Ask a query that should match a bundled skill (e.g., Playwright, browser automation)
  4. Observe: skill matcher initialized for N skill(s) where N = skills in custom path only (bundled skills absent)

Fix

In build_registry(), use self.skill_paths() instead of self.config.skills.paths.iter():

let skill_paths = self.skill_paths();  // already adds managed_dir correctly
let registry = SkillRegistry::load(&skill_paths);

Metadata

Metadata

Assignees

Labels

P2High value, medium complexitybugSomething isn't workingskillszeph-skills crate

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions