fix(todo-continuation): normalize prompt agent

Todo continuation could reinject with a lowercase built-in config key such as hephaestus when no registered alias was available. OpenCode prompt dispatch expects the prompt-facing agent name, so the continuation failed with an agent-not-found error.

Normalize the dispatch fallback through the existing prompt agent display-name resolver and pin the lowercase Hephaestus regression.
This commit is contained in:
YeonGyu-Kim
2026-05-20 23:07:52 +09:00
parent 32f0e1e0af
commit 1e42c61026
2 changed files with 50 additions and 2 deletions
@@ -20,8 +20,8 @@ import { log } from "../../shared/logger"
import { isSqliteBackend } from "../../shared/opencode-storage-detection"
import {
getAgentConfigKey,
normalizeAgentForPrompt,
normalizeAgentForPromptKey,
stripAgentListSortPrefix,
} from "../../shared/agent-display-names"
import { dispatchInternalPrompt, isInternalPromptDispatchAccepted } from "../shared/prompt-async-gate"
@@ -134,7 +134,7 @@ export async function injectContinuation(args: {
const promptAgent = normalizeAgentForPromptKey(agentName)
const resolvedAgent = resolveRegisteredAgentName(agentName)
const launchAgent = resolvedAgent ? stripAgentListSortPrefix(resolvedAgent) : resolvedAgent
const launchAgent = normalizeAgentForPrompt(resolvedAgent ?? agentName)
if (promptAgent && skipAgents.some(s => getAgentConfigKey(s) === getAgentConfigKey(promptAgent))) {
log(`[${HOOK_NAME}] Skipped: agent in skipAgents list`, { sessionID, agent: agentName })