fix(delegate-task): reject primary agents in task subagent resolution

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-04-13 15:52:44 +09:00
parent f1cd4d73d6
commit 01a1b141e9
8 changed files with 224 additions and 115 deletions
@@ -31,4 +31,20 @@ function createDelegateTask(...args: Parameters<typeof import("./tools").createD
expect(categorySchema.def.type).toBe("optional")
expect(categorySchema.def.innerType.def.type).toBe("string")
})
test("#given task description #when tool is created #then primary agents are not advertised for subagent_type", () => {
//#given
const toolDefinition = createDelegateTask({ manager: {} as never, client: {} as never, directory: "/tmp/test" })
//#when
const description = toolDefinition.description
//#then
expect(description).toContain("subagent_type: Use specific agent directly")
expect(description).not.toContain("sisyphus")
expect(description).not.toContain("hephaestus")
expect(description).not.toContain("prometheus")
})
})
export {}