Sfoglia il codice sorgente

fix: handle skill scan failures for .claude gracefully

Aiden Cline 1 mese fa
parent
commit
f2e65e40ea
1 ha cambiato i file con 14 aggiunte e 7 eliminazioni
  1. 14 7
      packages/opencode/src/skill/skill.ts

+ 14 - 7
packages/opencode/src/skill/skill.ts

@@ -81,13 +81,20 @@ export namespace Skill {
     }
 
     for (const dir of claudeDirs) {
-      for await (const match of CLAUDE_SKILL_GLOB.scan({
-        cwd: dir,
-        absolute: true,
-        onlyFiles: true,
-        followSymlinks: true,
-        dot: true,
-      })) {
+      const matches = await Array.fromAsync(
+        CLAUDE_SKILL_GLOB.scan({
+          cwd: dir,
+          absolute: true,
+          onlyFiles: true,
+          followSymlinks: true,
+          dot: true,
+        }),
+      ).catch((error) => {
+        log.error("failed .claude directory scan for skills", { dir, error })
+        return []
+      })
+
+      for (const match of matches) {
         await addSkill(match)
       }
     }