-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Description
Summary
Claude Code 2.1.x renamed the Task tool to Agent. PAI v4.0.3's settings.json still references the old name in two places, causing hook failures and dead permissions.
Affected Locations
1. Hook matcher (line ~115 in settings.json)
// Current (broken)
{ "matcher": "Task", "hooks": [{ "type": "command", "command": "${PAI_DIR}/hooks/AgentExecutionGuard.hook.ts" }] }
// Fix
{ "matcher": "Agent", "hooks": [{ "type": "command", "command": "${PAI_DIR}/hooks/AgentExecutionGuard.hook.ts" }] }2. Permissions allow list
// Current (dead entry)
"allow": [ ..., "Task", ... ]
// Fix
"allow": [ ..., "Agent", ... ]3. Hook script comments
hooks/AgentExecutionGuard.hook.ts line 10:
// Current: TRIGGER: PreToolUse (matcher: Task)
// Fix: TRIGGER: PreToolUse (matcher: Agent)
Symptoms
PreToolUse:Agent hook erroron every Agent/background agent tool callAgentExecutionGuardhook never fires (matcher"Task"doesn't match the renamed"Agent"tool)"Task"inpermissions.allowis a dead entry granting nothing
Reproduction
- Install PAI v4.0.3
- Use Claude Code 2.1.77 (or any 2.1.x where Task was renamed to Agent)
- Spawn any background agent
- Observe
PreToolUse:Agent hook errorin output
Environment
- Claude Code: 2.1.77
- PAI: v4.0.3
- OS: macOS (Darwin 25.3.0)
Related
- 4.0.3 upgrade overwrites configured settings.json with template placeholders #893 —
PAI_DIRnested${HOME}expansion (samesettings.json, different root cause)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels