feat(subagent): block question tool at both SDK and hook level

- Add permission: [{ permission: 'question', action: 'deny' }] to session.create()
  in background-agent and delegate-task for SDK-level blocking
- Add subagent-question-blocker hook as backup layer to intercept question tool
  calls in tool.execute.before event
- Ensures subagents cannot ask questions to users and must work autonomously
This commit is contained in:
justsisyphus
2026-01-27 11:03:44 +09:00
parent 04500bae7d
commit de439edc22
6 changed files with 123 additions and 2 deletions
+4 -1
View File
@@ -864,7 +864,10 @@ To continue this session: session_id="${task.sessionID}"`
body: {
parentID: ctx.sessionID,
title: `Task: ${args.description}`,
},
permission: [
{ permission: "question", action: "deny" as const, pattern: "*" },
],
} as any,
query: {
directory: parentDirectory,
},