Skip to content

curator restore: nested archive subdirs not found — restore_skill only scans top-level .archive/ #17942

@WompaJango

Description

@WompaJango

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

  1. Have an agent-created skill archived under a nested path: .archive/<category>/<skill>/
  2. Run hermes curator restore <skill> → fails with "not found"
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existstool/skillsSkills system (list, view, manage)type/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions