Describe the bug
hermes curator restore <skill> fails with "skill '' not found in archive" when the skill was archived under a nested subdirectory inside .archive/, e.g. .archive/openclaw-imports/<skill>/.
Root cause
restore_skill() in tools/skill_usage.py uses archive_root.iterdir() which only enumerates the immediate children of .archive/. It never descends into subdirectories like openclaw-imports/, hermes-agent/, etc.
Reproduction
- Have an agent-created skill archived under a nested path:
.archive/<category>/<skill>/
- Run
hermes curator restore <skill> → fails with "not found"
- The skill directory exists at that nested path but is never found
Fix
Change archive_root.iterdir() to archive_root.rglob('*') in both the exact-match and prefix-match candidate scans, so it recurses through all nested subdirectories.
Patch applied locally:
- candidates = [p for p in archive_root.iterdir() if p.is_dir() and p.name == skill_name]
+ # Recursive scan handles nested archive subdirs (e.g. .archive/openclaw-imports/cognitive-empathy).
+ candidates = [p for p in archive_root.rglob('*') if p.is_dir() and p.name == skill_name]
if not candidates:
candidates = sorted(
- [p for p in archive_root.iterdir()
+ [p for p in archive_root.rglob('*')
if p.is_dir() and p.name.startswith(f"{skill_name}-")],
reverse=True,
)
Environment
- Hermes Agent (local install)
restore_skill() at tools/skill_usage.py:389
Describe the bug
hermes curator restore <skill>fails with "skill '' not found in archive" when the skill was archived under a nested subdirectory inside.archive/, e.g..archive/openclaw-imports/<skill>/.Root cause
restore_skill()intools/skill_usage.pyusesarchive_root.iterdir()which only enumerates the immediate children of.archive/. It never descends into subdirectories likeopenclaw-imports/,hermes-agent/, etc.Reproduction
.archive/<category>/<skill>/hermes curator restore <skill>→ fails with "not found"Fix
Change
archive_root.iterdir()toarchive_root.rglob('*')in both the exact-match and prefix-match candidate scans, so it recurses through all nested subdirectories.Patch applied locally:
Environment
restore_skill()attools/skill_usage.py:389