fix(effect): reuse task tool id

This commit is contained in:
Kit Langton
2026-04-08 14:08:12 -04:00
parent 0f3a2a7b67
commit 5e54c54134
2 changed files with 7 additions and 3 deletions

View File

@@ -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,
)

View File

@@ -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(