From a3b84ec5f91a601c698903dbe25d0606ef703779 Mon Sep 17 00:00:00 2001 From: WhiteGiverMa Date: Fri, 27 Mar 2026 13:22:58 +0800 Subject: [PATCH] fix: use getAgentDisplayName in injectBoulderContinuation The agent parameter was using raw config key "atlas" but the SDK expects the display name "Atlas (Plan Executor)". This caused "Agent not found: 'atlas'" errors when auto-compact tried to continue boulder execution. Root cause: injectBoulderContinuation passed raw agent key to session.promptAsync, but SDK's agent matching logic compares against display names registered in the system. Fix: Use getAgentDisplayName() to convert the config key to the expected display name before passing to the SDK. --- src/hooks/atlas/boulder-continuation-injector.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hooks/atlas/boulder-continuation-injector.ts b/src/hooks/atlas/boulder-continuation-injector.ts index 2e01e9ab7..a9ffa5478 100644 --- a/src/hooks/atlas/boulder-continuation-injector.ts +++ b/src/hooks/atlas/boulder-continuation-injector.ts @@ -2,6 +2,7 @@ import type { PluginInput } from "@opencode-ai/plugin" import type { BackgroundManager } from "../../features/background-agent" import { log } from "../../shared/logger" import { createInternalAgentTextPart, resolveInheritedPromptTools } from "../../shared" +import { getAgentDisplayName } from "../../shared/agent-display-names" import { HOOK_NAME } from "./hook-name" import { BOULDER_CONTINUATION_PROMPT } from "./system-reminder-templates" import { resolveRecentPromptContextForSession } from "./recent-model-resolver" @@ -62,7 +63,7 @@ export async function injectBoulderContinuation(input: { await ctx.client.session.promptAsync({ path: { id: sessionID }, body: { - agent: agent ?? "atlas", + agent: getAgentDisplayName(agent ?? "atlas"), ...(promptContext.model !== undefined ? { model: promptContext.model } : {}), ...(inheritedTools ? { tools: inheritedTools } : {}), parts: [createInternalAgentTextPart(prompt)],