fix(start-work): restore atlas handoff

Keep native /start-work resolvable on Sisyphus, but switch the work session back to Atlas when Atlas is registered. Stamp the outgoing agent with Atlas's actual list-display key so config→start-work execution resolves correctly and still falls back to Sisyphus when Atlas is unavailable.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-03-31 20:02:00 -07:00
parent d029bc7621
commit 7f846b2da3
8 changed files with 503 additions and 153 deletions
+39
View File
@@ -0,0 +1,39 @@
import type { CreatedHooks } from "../create-hooks"
type CommandExecuteBeforeInput = {
command: string
sessionID: string
arguments: string
}
type CommandExecuteBeforeOutput = {
parts: Array<{ type: string; text?: string; [key: string]: unknown }>
}
function hasPartsOutput(value: unknown): value is CommandExecuteBeforeOutput {
if (typeof value !== "object" || value === null) return false
const record = value as Record<string, unknown>
const parts = record["parts"]
return Array.isArray(parts)
}
export function createCommandExecuteBeforeHandler(args: {
hooks: CreatedHooks
}): (
input: CommandExecuteBeforeInput,
output: CommandExecuteBeforeOutput,
) => Promise<void> {
const { hooks } = args
return async (input, output): Promise<void> => {
await hooks.autoSlashCommand?.["command.execute.before"]?.(input, output)
if (
hooks.startWork
&& input.command.toLowerCase() === "start-work"
&& hasPartsOutput(output)
) {
await hooks.startWork["command.execute.before"]?.(input, output)
}
}
}