From 6f3a1efae08e62a2990aa8d954265bd8245e72c4 Mon Sep 17 00:00:00 2001 From: ismeth Date: Wed, 25 Mar 2026 07:48:31 +0100 Subject: [PATCH] feat(tool-config): restrict council tools visibility to athena and athena-junior only --- .../tool-config-handler.test.ts | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/src/plugin-handlers/tool-config-handler.test.ts b/src/plugin-handlers/tool-config-handler.test.ts index e6cb1e222..8c60c5c51 100644 --- a/src/plugin-handlers/tool-config-handler.test.ts +++ b/src/plugin-handlers/tool-config-handler.test.ts @@ -348,4 +348,51 @@ describe("applyToolConfig", () => { ) }) }) + + describe("#given council tools are globally hidden", () => { + describe("#when applying tool config for Athena agents", () => { + it.each(["athena", "athena-junior"])( + "#then should expose council tools via agent tools for %s", + (agentName) => { + const params = createParams({ agents: [agentName] }) + + applyToolConfig(params) + + const agent = params.agentResult[agentName] as { + tools?: Record + permission: Record + } + expect(agent.tools?.prepare_council_prompt).toBe(true) + expect(agent.tools?.council_finalize).toBe(true) + expect(agent.tools?.athena_council).toBe(true) + expect(agent.permission.prepare_council_prompt).toBe("allow") + expect(agent.permission.council_finalize).toBe("allow") + expect(agent.permission.athena_council).toBe("allow") + }, + ) + }) + + describe("#when applying tool config for non-Athena agents", () => { + it.each(["atlas", "sisyphus", "prometheus", "hephaestus", "sisyphus-junior"])( + "#then should keep council tools hidden for %s", + (agentName) => { + const params = createParams({ agents: [agentName] }) + + applyToolConfig(params) + + const tools = params.config.tools as Record + const agent = params.agentResult[agentName] as { + tools?: Record + permission: Record + } + expect(tools.prepare_council_prompt).toBe(false) + expect(tools.council_finalize).toBe(false) + expect(tools.athena_council).toBe(false) + expect(agent.tools?.prepare_council_prompt).toBeUndefined() + expect(agent.tools?.council_finalize).toBeUndefined() + expect(agent.tools?.athena_council).toBeUndefined() + }, + ) + }) + }) })