feat(delegate-task): add prometheus self-delegation block and delegate_task permission

- Block prometheus from delegating to itself via delegate_task
- Grant delegate_task permission to prometheus when called as subagent
- Other subagents still have delegate_task disabled
This commit is contained in:
justsisyphus
2026-01-28 17:52:19 +09:00
parent 0bb9a0d4b8
commit 62a4c7bde1
2 changed files with 254 additions and 1 deletions
+8 -1
View File
@@ -768,6 +768,12 @@ To continue this session: session_id="${sessionID}"`
Sisyphus-Junior is spawned automatically when you specify a category. Pick the appropriate category for your task domain.`
}
if (isPlanAgent(agentName) && isPlanAgent(parentAgent)) {
return `You are prometheus. You cannot delegate to prometheus via delegate_task.
Create the work plan directly - that's your job as the planning agent.`
}
agentToUse = agentName
// Validate agent exists and is callable (not a primary agent)
@@ -927,6 +933,7 @@ To continue this session: session_id="${task.sessionID}"`
})
try {
const allowDelegateTask = isPlanAgent(agentToUse)
await client.session.prompt({
path: { id: sessionID },
body: {
@@ -934,7 +941,7 @@ To continue this session: session_id="${task.sessionID}"`
system: systemContent,
tools: {
task: false,
delegate_task: false,
delegate_task: allowDelegateTask,
call_omo_agent: true,
question: false,
},