fix(start-work): always hand off to atlas regardless of current session agent (#3155)

/start-work is the "execute this plan with atlas" command.
Previously, if the user's current session agent was sisyphus (or any
non-prometheus/non-atlas agent), the hook would keep that agent instead
of switching to atlas. This caused sisyphus to execute the plan.

Fix: unconditionally select atlas (when registered) or sisyphus (fallback).
The current session agent is irrelevant to /start-work's intent.

Adds regression test: running /start-work from a sisyphus session must
always hand off to atlas when atlas is available.
This commit is contained in:
YeonGyu-Kim
2026-04-06 19:55:04 +09:00
parent 23180c6ba6
commit 3e8fd5ff18
2 changed files with 24 additions and 14 deletions
+3 -14
View File
@@ -12,12 +12,10 @@ import {
} from "../../features/boulder-state"
import { log } from "../../shared/logger"
import {
getAgentConfigKey,
getAgentDisplayName,
getAgentListDisplayName,
} from "../../shared/agent-display-names"
import {
getSessionAgent,
isAgentRegistered,
updateSessionAgent,
} from "../../features/claude-code-session-state"
@@ -84,18 +82,9 @@ export function createStartWorkHook(ctx: PluginInput) {
}
log(`[${HOOK_NAME}] Processing start-work command`, { sessionID: input.sessionID })
const currentSessionAgent = getSessionAgent(input.sessionID)
const currentSessionAgentKey = currentSessionAgent
? getAgentConfigKey(currentSessionAgent)
: undefined
const activeAgent = currentSessionAgent
&& currentSessionAgentKey
&& currentSessionAgentKey !== "prometheus"
&& currentSessionAgentKey !== "atlas"
? currentSessionAgent
: isAgentRegistered("atlas")
? "atlas"
: "sisyphus"
const activeAgent = isAgentRegistered("atlas")
? "atlas"
: "sisyphus"
const activeAgentDisplayName = activeAgent === "atlas"
? getAgentListDisplayName(activeAgent)
: getAgentDisplayName(activeAgent)