fix: support Agent tool for sub-agent visualization#64
fix: support Agent tool for sub-agent visualization#64erichprates wants to merge 1 commit intopablodelucca:mainfrom
Conversation
The Agent tool (used by Claude Code's Task tool invocations) was not being visualized as a sub-agent character in the Pixel Agents office. Three changes in transcriptParser.ts: 1. Add 'Agent' to PERMISSION_EXEMPT_TOOLS so it does not trigger the false permission-wait heuristic while the sub-agent is running. 2. Add `case 'Agent':` before `case 'Task':` in formatToolStatus so the status string starts with "Subtask: <description>". The webview checks for this prefix to call addSubagent() and spawn a new pixel character linked to the parent agent. 3. Include 'Agent' in the subagentClear guard so the spawned character is correctly despawned when the Agent tool completes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
I independently found the same issue and submitted a similar fix in #76. My PR also covers a 4th location that this one is missing: the progress record handler in processProgressRecord() (~line 207) that validates the parent tool name. Without that fix, sub-agent progress records (tool activity within sub-agents) are silently ignored for the Agent tool. Happy to close mine if this one adds that 4th fix, or the maintainer can pick whichever. |
|
Hey @erichprates, thanks for catching this and for the clear write-up, great fix :) @drewf, thanks for flagging that extra spot, it should be included as well Closing as superseded, appreciate the contributions from both of you! |
The Agent tool (used by Claude Code's Task tool invocations) was not being visualized as a sub-agent character in the Pixel Agents office.
Three changes in transcriptParser.ts:
Add 'Agent' to PERMISSION_EXEMPT_TOOLS so it does not trigger the false permission-wait heuristic while the sub-agent is running.
Add
case 'Agent':beforecase 'Task':in formatToolStatus so the status string starts with "Subtask: ". The webview checks for this prefix to call addSubagent() and spawn a new pixel character linked to the parent agent.Include 'Agent' in the subagentClear guard so the spawned character is correctly despawned when the Agent tool completes.