Merge pull request #2575 from apple-ouyang/fix/issue-2571-subagent-safeguards
fix(delegate-task): add subagent turn limit and model routing transparency
This commit is contained in:
@@ -149,9 +149,23 @@ export async function executeSyncTask(
|
||||
|
||||
const duration = formatDuration(startTime)
|
||||
|
||||
// 检测模型路由是否与父 session 不同,给用户可见的提示
|
||||
const actualModelStr = categoryModel
|
||||
? `${categoryModel.providerID}/${categoryModel.modelID}`
|
||||
: undefined
|
||||
const parentModelStr = parentContext.model
|
||||
? `${parentContext.model.providerID}/${parentContext.model.modelID}`
|
||||
: undefined
|
||||
const modelRoutingNote =
|
||||
actualModelStr && parentModelStr && actualModelStr !== parentModelStr
|
||||
? `\n⚠️ Model routing: parent used ${parentModelStr}, this subagent used ${actualModelStr} (via category: ${args.category ?? "unknown"})`
|
||||
: actualModelStr
|
||||
? `\nModel: ${actualModelStr}${args.category ? ` (category: ${args.category})` : ""}`
|
||||
: ""
|
||||
|
||||
return `Task completed in ${duration}.
|
||||
|
||||
Agent: ${agentToUse}${args.category ? ` (category: ${args.category})` : ""}
|
||||
Agent: ${agentToUse}${args.category ? ` (category: ${args.category})` : ""}${modelRoutingNote}
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user