Merge pull request #2583 from Jrakru/fix/start-work-atlas-handoff
fix: preserve Atlas handoff metadata on /start-work
This commit is contained in:
@@ -404,6 +404,24 @@ describe("start-work hook", () => {
|
|||||||
expect(updateSpy).toHaveBeenCalledWith("ses-prometheus-to-sisyphus", "atlas")
|
expect(updateSpy).toHaveBeenCalledWith("ses-prometheus-to-sisyphus", "atlas")
|
||||||
updateSpy.mockRestore()
|
updateSpy.mockRestore()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test("should stamp the outgoing message with Atlas so follow-up events keep the handoff", async () => {
|
||||||
|
// given
|
||||||
|
const hook = createStartWorkHook(createMockPluginInput())
|
||||||
|
const output = {
|
||||||
|
message: {},
|
||||||
|
parts: [{ type: "text", text: "<session-context></session-context>" }],
|
||||||
|
}
|
||||||
|
|
||||||
|
// when
|
||||||
|
await hook["chat.message"](
|
||||||
|
{ sessionID: "ses-prometheus-to-atlas" },
|
||||||
|
output
|
||||||
|
)
|
||||||
|
|
||||||
|
// then
|
||||||
|
expect(output.message.agent).toBe("Atlas (Plan Executor)")
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("worktree support", () => {
|
describe("worktree support", () => {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import {
|
|||||||
clearBoulderState,
|
clearBoulderState,
|
||||||
} from "../../features/boulder-state"
|
} from "../../features/boulder-state"
|
||||||
import { log } from "../../shared/logger"
|
import { log } from "../../shared/logger"
|
||||||
|
import { getAgentDisplayName } from "../../shared/agent-display-names"
|
||||||
import { updateSessionAgent } from "../../features/claude-code-session-state"
|
import { updateSessionAgent } from "../../features/claude-code-session-state"
|
||||||
import { detectWorktreePath } from "./worktree-detector"
|
import { detectWorktreePath } from "./worktree-detector"
|
||||||
import { parseUserRequest } from "./parse-user-request"
|
import { parseUserRequest } from "./parse-user-request"
|
||||||
@@ -23,6 +24,7 @@ interface StartWorkHookInput {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface StartWorkHookOutput {
|
interface StartWorkHookOutput {
|
||||||
|
message?: Record<string, unknown>
|
||||||
parts: Array<{ type: string; text?: string }>
|
parts: Array<{ type: string; text?: string }>
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,6 +81,9 @@ export function createStartWorkHook(ctx: PluginInput) {
|
|||||||
|
|
||||||
log(`[${HOOK_NAME}] Processing start-work command`, { sessionID: input.sessionID })
|
log(`[${HOOK_NAME}] Processing start-work command`, { sessionID: input.sessionID })
|
||||||
updateSessionAgent(input.sessionID, "atlas")
|
updateSessionAgent(input.sessionID, "atlas")
|
||||||
|
if (output.message) {
|
||||||
|
output.message["agent"] = getAgentDisplayName("atlas")
|
||||||
|
}
|
||||||
|
|
||||||
const existingState = readBoulderState(ctx.directory)
|
const existingState = readBoulderState(ctx.directory)
|
||||||
const sessionId = input.sessionID
|
const sessionId = input.sessionID
|
||||||
|
|||||||
Reference in New Issue
Block a user