fix(delegation): restore category to sisyphus-junior auto-mapping

Category-based delegation should always route to sisyphus-junior even if
subagent_type is mistakenly provided, matching the original behavior and
preventing accidental bypass of category routing.
This commit is contained in:
YeonGyu-Kim
2026-02-09 16:14:30 +09:00
parent 11f587194f
commit a5bdb64933
2 changed files with 74 additions and 6 deletions
+7 -5
View File
@@ -86,7 +86,13 @@ Prompts MUST be in English.`
async execute(args: DelegateTaskArgs, toolContext) {
const ctx = toolContext as ToolContextWithMetadata
if (args.category && !args.subagent_type) {
if (args.category) {
if (args.subagent_type && args.subagent_type !== "sisyphus-junior") {
log("[task] category provided - overriding subagent_type to sisyphus-junior", {
category: args.category,
subagent_type: args.subagent_type,
})
}
args.subagent_type = "sisyphus-junior"
}
await ctx.metadata?.({
@@ -123,10 +129,6 @@ Prompts MUST be in English.`
return executeSyncContinuation(args, ctx, options)
}
if (args.category && args.subagent_type && args.subagent_type !== "sisyphus-junior") {
return `Invalid arguments: Provide EITHER category OR subagent_type, not both.`
}
if (!args.category && !args.subagent_type) {
return `Invalid arguments: Must provide either category or subagent_type.`
}