Skip to content

Commit aacdb34

Browse files
authored
fix(opencode): avoid duplicate skill catalog (anomalyco#31269)
1 parent 233427f commit aacdb34

2 files changed

Lines changed: 3 additions & 21 deletions

File tree

‎packages/opencode/src/tool/registry.ts‎

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ export const layer: Layer.Layer<
112112
const config = yield* Config.Service
113113
const plugin = yield* Plugin.Service
114114
const agents = yield* Agent.Service
115-
const skill = yield* Skill.Service
116115
const truncate = yield* Truncate.Service
117116
const flags = yield* RuntimeFlags.Service
118117

@@ -276,25 +275,6 @@ export const layer: Layer.Layer<
276275
return (yield* all()).map((tool) => tool.id)
277276
})
278277

279-
const describeSkill = Effect.fn("ToolRegistry.describeSkill")(function* (agent: Agent.Info) {
280-
const list = yield* skill.available(agent)
281-
if (list.length === 0) return "No skills are currently available."
282-
return [
283-
"Load a specialized skill that provides domain-specific instructions and workflows.",
284-
"",
285-
"When you recognize that a task matches one of the available skills listed below, use this tool to load the full skill instructions.",
286-
"",
287-
"The skill will inject detailed instructions, workflows, and access to bundled resources (scripts, references, templates) into the conversation context.",
288-
"",
289-
'Tool output includes a `<skill_content name="...">` block with the loaded content.',
290-
"",
291-
"The following skills provide specialized sets of instructions for particular tasks",
292-
"Invoke this tool to load a skill when a task matches one of the available skills listed below:",
293-
"",
294-
Skill.fmt(list, { verbose: false }),
295-
].join("\n")
296-
})
297-
298278
const describeTask = Effect.fn("ToolRegistry.describeTask")(function* (agent: Agent.Info) {
299279
const items = (yield* agents.list()).filter((item) => item.mode !== "primary")
300280
const filtered = items.filter(
@@ -343,7 +323,6 @@ export const layer: Layer.Layer<
343323
description: [
344324
output.description,
345325
tool.id === TaskTool.id ? yield* describeTask(input.agent) : undefined,
346-
tool.id === SkillTool.id ? yield* describeSkill(input.agent) : undefined,
347326
]
348327
.filter(Boolean)
349328
.join("\n"),

‎packages/opencode/test/tool/skill.test.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ Use this skill.
6868
})).find((tool) => tool.id === SkillTool.id)
6969
if (!tool) throw new Error("Skill tool not found")
7070

71+
expect(tool.description).not.toContain("tool-skill")
72+
expect(tool.description).not.toContain("Skill for tool tests.")
73+
7174
const requests: Array<Omit<PermissionV1.Request, "id" | "sessionID" | "tool">> = []
7275
const ctx: Tool.Context = {
7376
...baseCtx,

0 commit comments

Comments
 (0)