fix(athena): use getAgentConfigKey for keyword-detector Athena exclusion

The previous check used currentAgent?.toLowerCase() === 'athena' which failed

after display name remapping stored the agent as 'Athena (Council)' in session

state. Now uses getAgentConfigKey() to resolve display names back to config keys,

matching the established pattern used by other hooks (atlas, todo-continuation, etc.).

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
ismeth
2026-02-17 14:38:45 +01:00
committed by YeonGyu-Kim
parent fb117fa5a3
commit 72f4669c7f
2 changed files with 54 additions and 1 deletions
+4 -1
View File
@@ -11,6 +11,7 @@ import {
getSessionAgent,
subagentSessions,
} from "../../features/claude-code-session-state"
import { getAgentConfigKey } from "../../shared/agent-display-names"
import type { ContextCollector } from "../../features/context-injector"
import type { RalphLoopHook } from "../ralph-loop"
@@ -72,7 +73,9 @@ 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.
if (currentAgent?.toLowerCase() === "athena") {
// Use getAgentConfigKey to handle display name remapping ("Athena (Council)" → "athena").
const agentConfigKey = currentAgent ? getAgentConfigKey(currentAgent) : undefined
if (agentConfigKey === "athena") {
log(`[keyword-detector] Skipping all keywords for Athena (council orchestrator)`, {
sessionID: input.sessionID,
skippedTypes: detectedKeywords.map((k) => k.type),