From 5769a48a94c6e61a70e2472b593bcd88133cbebc Mon Sep 17 00:00:00 2001 From: ismeth Date: Thu, 19 Feb 2026 02:21:33 +0100 Subject: [PATCH] fix(athena): update council member guards for new agent key format The hasPendingCouncilMembers guard now matches the 'Council: ' prefix from COUNCIL_MEMBER_KEY_PREFIX instead of the old task.agent === 'council-member' check. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus --- src/hooks/keyword-detector/hook.ts | 2 +- src/plugin/tool-execute-before.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hooks/keyword-detector/hook.ts b/src/hooks/keyword-detector/hook.ts index a3d014545..660d2d0ec 100644 --- a/src/hooks/keyword-detector/hook.ts +++ b/src/hooks/keyword-detector/hook.ts @@ -72,7 +72,7 @@ export function createKeywordDetectorHook( // Athena is a council orchestrator — skip all keyword injections. // search/analyze modes tell the agent to use explore agents and grep directly, - // which conflicts with Athena's job of calling athena_council for council fan-out. + // which conflicts with Athena's job of launching council members via task calls. // Use getAgentConfigKey to handle display name remapping ("Athena (Council)" → "athena"). const agentConfigKey = currentAgent ? getAgentConfigKey(currentAgent) : undefined if (agentConfigKey === "athena") { diff --git a/src/plugin/tool-execute-before.ts b/src/plugin/tool-execute-before.ts index 33da06986..fb49c2e75 100644 --- a/src/plugin/tool-execute-before.ts +++ b/src/plugin/tool-execute-before.ts @@ -12,6 +12,7 @@ import { ULTRAWORK_VERIFICATION_PROMISE } from "../hooks/ralph-loop/constants" import { readState, writeState } from "../hooks/ralph-loop/storage" import type { CreatedHooks } from "../create-hooks" +import { COUNCIL_MEMBER_KEY_PREFIX } from "../agents/builtin-agents/council-member-agents" function getLoopCommandArguments(args: Record, command: "ralph-loop" | "ulw-loop"): string { const rawUserMessage = typeof args.user_message === "string" ? args.user_message.trim() : "" @@ -40,7 +41,7 @@ export function createToolExecuteBeforeHandler(args: { const tasks = backgroundManager.getTasksByParentSession(sessionID) return tasks.some((task) => - task.agent === "council-member" && + (task.agent === "council-member" || task.agent.startsWith(COUNCIL_MEMBER_KEY_PREFIX)) && (task.status === "pending" || task.status === "running") ) }