Summary
When a (background) subagent's tool call requires user approval, the approval prompt renders in the main TUI, but:
- no
PermissionRequest hook fires, and
- nothing is written to either the main or the subagent
wire.jsonl while the prompt is pending.
Only after the user decides does the subagent wire record interaction.resolved and permission.record_approval_result. Approvals triggered by the main agent's own tool calls are unaffected.
Environment
- kimi-code 2.1.1
- Windows 11
- Permission mode: Ask When Needed
Steps to reproduce
- Configure a
PermissionRequest hook in ~/.kimi-code/config.toml, e.g. one that appends the stdin payload to a log file.
- In an interactive session, have the main agent dispatch a background
coder subagent that executes a command requiring approval (e.g. a recursive delete).
- Wait for the approval prompt to appear in the TUI.
Actual behavior
- The approval prompt renders and waits in the main TUI.
- The
PermissionRequest hook is never invoked (log stays empty).
- Neither
agents/main/wire.jsonl nor agents/<subagent>/wire.jsonl records anything while the prompt is pending; the subagent wire only records interaction.resolved and permission.record_approval_result after the user approves or rejects.
Expected behavior
PermissionRequest fires for subagent-originated approval waits too — ideally carrying agent identity (agent_name / agent_id) as proposed in #3742, so observers can tell which subagent is blocked.
Impact
Any external approval-notification tooling (terminal workbenches, remote approval via hooks) cannot detect that the session is blocked on a subagent approval. From the outside the session looks idle while it is actually waiting for the user. This defeats hook-driven approval UX exactly where it is most needed: unattended background delegation.
Related
Summary
When a (background) subagent's tool call requires user approval, the approval prompt renders in the main TUI, but:
PermissionRequesthook fires, andwire.jsonlwhile the prompt is pending.Only after the user decides does the subagent wire record
interaction.resolvedandpermission.record_approval_result. Approvals triggered by the main agent's own tool calls are unaffected.Environment
Steps to reproduce
PermissionRequesthook in~/.kimi-code/config.toml, e.g. one that appends the stdin payload to a log file.codersubagent that executes a command requiring approval (e.g. a recursive delete).Actual behavior
PermissionRequesthook is never invoked (log stays empty).agents/main/wire.jsonlnoragents/<subagent>/wire.jsonlrecords anything while the prompt is pending; the subagent wire only recordsinteraction.resolvedandpermission.record_approval_resultafter the user approves or rejects.Expected behavior
PermissionRequestfires for subagent-originated approval waits too — ideally carrying agent identity (agent_name/agent_id) as proposed in #3742, so observers can tell which subagent is blocked.Impact
Any external approval-notification tooling (terminal workbenches, remote approval via hooks) cannot detect that the session is blocked on a subagent approval. From the outside the session looks idle while it is actually waiting for the user. This defeats hook-driven approval UX exactly where it is most needed: unattended background delegation.
Related
PermissionRequest/PermissionResultas beneficiaries)