diff --git a/src/transcriptParser.ts b/src/transcriptParser.ts index 059b42b5..c5d699ad 100644 --- a/src/transcriptParser.ts +++ b/src/transcriptParser.ts @@ -15,7 +15,7 @@ import { TASK_DESCRIPTION_DISPLAY_MAX_LENGTH, } from './constants.js'; -export const PERMISSION_EXEMPT_TOOLS = new Set(['Task', 'AskUserQuestion']); +export const PERMISSION_EXEMPT_TOOLS = new Set(['Task', 'Agent', 'AskUserQuestion']); export function formatToolStatus(toolName: string, input: Record): string { const base = (p: unknown) => typeof p === 'string' ? path.basename(p) : ''; @@ -31,6 +31,7 @@ export function formatToolStatus(toolName: string, input: Record TASK_DESCRIPTION_DISPLAY_MAX_LENGTH ? desc.slice(0, TASK_DESCRIPTION_DISPLAY_MAX_LENGTH) + '\u2026' : desc}` : 'Running subtask'; @@ -108,8 +109,8 @@ export function processTranscriptLine( if (block.type === 'tool_result' && block.tool_use_id) { console.log(`[Pixel Agents] Agent ${agentId} tool done: ${block.tool_use_id}`); const completedToolId = block.tool_use_id; - // If the completed tool was a Task, clear its subagent tools - if (agent.activeToolNames.get(completedToolId) === 'Task') { + // If the completed tool was a Task or Agent, clear its subagent tools + if (agent.activeToolNames.get(completedToolId) === 'Task' || agent.activeToolNames.get(completedToolId) === 'Agent') { agent.activeSubagentToolIds.delete(completedToolId); agent.activeSubagentToolNames.delete(completedToolId); webview?.postMessage({