diff --git a/packages/opencode/src/session/prompt.ts b/packages/opencode/src/session/prompt.ts index c297339992..3c9988ea30 100644 --- a/packages/opencode/src/session/prompt.ts +++ b/packages/opencode/src/session/prompt.ts @@ -600,7 +600,11 @@ NOTE: At any point in time through this workflow you should feel free to ask the subagent_type: task.agent, command: task.command, } - yield* plugin.trigger("tool.execute.before", { tool: "task", sessionID, callID: part.id }, { args: taskArgs }) + yield* plugin.trigger( + "tool.execute.before", + { tool: TaskTool.id, sessionID, callID: part.id }, + { args: taskArgs }, + ) const taskAgent = yield* agents.get(task.agent) if (!taskAgent) { @@ -679,7 +683,7 @@ NOTE: At any point in time through this workflow you should feel free to ask the yield* plugin.trigger( "tool.execute.after", - { tool: "task", sessionID, callID: part.id, args: taskArgs }, + { tool: TaskTool.id, sessionID, callID: part.id, args: taskArgs }, result, ) diff --git a/packages/opencode/src/tool/task.ts b/packages/opencode/src/tool/task.ts index e9635e39ed..73b55a2fba 100644 --- a/packages/opencode/src/tool/task.ts +++ b/packages/opencode/src/tool/task.ts @@ -181,7 +181,7 @@ export const TaskDescription: Tool.DynamicDescription = (agent) => const items = yield* Effect.promise(() => Agent.list().then((items) => items.filter((item) => item.mode !== "primary")), ) - const filtered = items.filter((item) => Permission.evaluate("task", item.name, agent.permission).action !== "deny") + const filtered = items.filter((item) => Permission.evaluate(id, item.name, agent.permission).action !== "deny") const list = filtered.toSorted((a, b) => a.name.localeCompare(b.name)) const description = list .map(