fix(tools/skill): harden description pipeline against empty skill list after lazy factory

This commit is contained in:
Sisyphus
2026-04-18 14:57:44 +09:00
parent 0e1a946c1d
commit 8e3f4cc63c
3 changed files with 120 additions and 60 deletions
+3 -3
View File
@@ -28,10 +28,10 @@ export function createSkillTool(options: SkillLoadOptions = {}): ToolDefinition
let cachedDescription: string | null = null
const getSkills = async (): Promise<LoadedSkill[]> => {
const discovered = await getAllSkills({
const discovered = (await getAllSkills({
disabledSkills: options?.disabledSkills,
browserProvider: options?.browserProvider,
})
})) ?? []
const allSkills = !options.skills
? discovered
: [
@@ -56,7 +56,7 @@ export function createSkillTool(options: SkillLoadOptions = {}): ToolDefinition
return discoverCommandsSync(undefined, {
pluginsEnabled: options.pluginsEnabled,
enabledPluginsOverride: options.enabledPluginsOverride,
})
}) ?? []
}
const buildDescription = async (force = false): Promise<string> => {