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