Description
prompt.ts has the same before/after plugin hook logic inline in 3 separate places, and none of them pass agent to the hooks. This means plugins can't tell which agent made a tool call — a blocker for any plugin that needs per-agent policy (audit logging, permission enforcement, etc).
Steps to reproduce
- Create a plugin that hooks
tool.execute.before and logs the input
- Trigger tool calls from different agents (primary + subagents via task)
- Observe that the hook input has no
agent field — the plugin can't distinguish who made the call
Fix
PR #13521 adds Tool.invoke() that centralizes hook wrapping and adds agent to the hook input.
The original batch bypass issue is moot since batch is experimental and being deprecated.
Description
prompt.tshas the same before/after plugin hook logic inline in 3 separate places, and none of them passagentto the hooks. This means plugins can't tell which agent made a tool call — a blocker for any plugin that needs per-agent policy (audit logging, permission enforcement, etc).Steps to reproduce
tool.execute.beforeand logs the inputagentfield — the plugin can't distinguish who made the callFix
PR #13521 adds
Tool.invoke()that centralizes hook wrapping and addsagentto the hook input.The original batch bypass issue is moot since batch is experimental and being deprecated.