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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user