Skip to content

Commit f2e65e4

Browse files
committed
fix: handle skill scan failures for .claude gracefully
1 parent 8b3ae08 commit f2e65e4

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

packages/opencode/src/skill/skill.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,20 @@ export namespace Skill {
8181
}
8282

8383
for (const dir of claudeDirs) {
84-
for await (const match of CLAUDE_SKILL_GLOB.scan({
85-
cwd: dir,
86-
absolute: true,
87-
onlyFiles: true,
88-
followSymlinks: true,
89-
dot: true,
90-
})) {
84+
const matches = await Array.fromAsync(
85+
CLAUDE_SKILL_GLOB.scan({
86+
cwd: dir,
87+
absolute: true,
88+
onlyFiles: true,
89+
followSymlinks: true,
90+
dot: true,
91+
}),
92+
).catch((error) => {
93+
log.error("failed .claude directory scan for skills", { dir, error })
94+
return []
95+
})
96+
97+
for (const match of matches) {
9198
await addSkill(match)
9299
}
93100
}

0 commit comments

Comments
 (0)