refactor(task): align continuation ids with task_id
This commit is contained in:
@@ -100,12 +100,21 @@ export function createToolExecuteBeforeHandler(args: {
|
||||
const argsObject = output.args
|
||||
const category = typeof argsObject.category === "string" ? argsObject.category : undefined
|
||||
const subagentType = typeof argsObject.subagent_type === "string" ? argsObject.subagent_type : undefined
|
||||
const sessionId = typeof argsObject.session_id === "string" ? argsObject.session_id : undefined
|
||||
const taskId =
|
||||
typeof argsObject.task_id === "string"
|
||||
? argsObject.task_id
|
||||
: typeof argsObject.session_id === "string"
|
||||
? argsObject.session_id
|
||||
: undefined
|
||||
|
||||
if (taskId && typeof argsObject.task_id !== "string") {
|
||||
argsObject.task_id = taskId
|
||||
}
|
||||
|
||||
if (category) {
|
||||
argsObject.subagent_type = "sisyphus-junior"
|
||||
} else if (!subagentType && sessionId) {
|
||||
const resolvedAgent = await resolveSessionAgent(ctx.client, sessionId)
|
||||
} else if (!subagentType && taskId) {
|
||||
const resolvedAgent = await resolveSessionAgent(ctx.client, taskId)
|
||||
argsObject.subagent_type = resolvedAgent ?? "continue"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user