fix(#2754): include native PluginInput skills in skill() discovery

The skill tool previously only merged disk-discovered skills and preloaded
options.skills, so skills registered natively via ctx.skills (for example
from config.skills.paths or other plugins) were prompt-visible but not
discoverable by skill().

Fix:
- pass ctx.skills from tool-registry into createSkillTool
- extend SkillLoadOptions with nativeSkills accessor
- merge nativeSkills.all() results into getSkills()
- add test covering native PluginInput skill discovery
This commit is contained in:
YeonGyu-Kim
2026-03-27 17:42:43 +09:00
parent d3dbb4976e
commit 76bf269b39
4 changed files with 64 additions and 4 deletions
+2
View File
@@ -1,4 +1,5 @@
import type { ToolDefinition } from "@opencode-ai/plugin"
import type { SkillLoadOptions } from "../tools/skill/types"
import type {
AvailableCategory,
@@ -112,6 +113,7 @@ export function createToolRegistry(args: {
mcpManager: managers.skillMcpManager,
getSessionID: getSessionIDForMcp,
gitMasterConfig: pluginConfig.git_master,
nativeSkills: "skills" in ctx ? (ctx as { skills: SkillLoadOptions["nativeSkills"] }).skills : undefined,
})
// task_system defaults to true since v3.14 — delegation (oracle, subagents) requires it