Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/transcriptParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, unknown>): string {
const base = (p: unknown) => typeof p === 'string' ? path.basename(p) : '';
Expand All @@ -31,7 +31,8 @@ export function formatToolStatus(toolName: string, input: Record<string, unknown
case 'Grep': return 'Searching code';
case 'WebFetch': return 'Fetching web content';
case 'WebSearch': return 'Searching the web';
case 'Task': {
case 'Task':
case 'Agent': {
const desc = typeof input.description === 'string' ? input.description : '';
return desc ? `Subtask: ${desc.length > TASK_DESCRIPTION_DISPLAY_MAX_LENGTH ? desc.slice(0, TASK_DESCRIPTION_DISPLAY_MAX_LENGTH) + '\u2026' : desc}` : 'Running subtask';
}
Expand Down Expand Up @@ -108,8 +109,9 @@ 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/Agent, clear its subagent tools
const completedToolName = agent.activeToolNames.get(completedToolId);
if (completedToolName === 'Task' || completedToolName === 'Agent') {
agent.activeSubagentToolIds.delete(completedToolId);
agent.activeSubagentToolNames.delete(completedToolId);
webview?.postMessage({
Expand Down Expand Up @@ -203,8 +205,9 @@ function processProgressRecord(
return;
}

// Verify parent is an active Task tool (agent_progress handling)
if (agent.activeToolNames.get(parentToolId) !== 'Task') return;
// Verify parent is an active Task/Agent tool (agent_progress handling)
const parentToolName = agent.activeToolNames.get(parentToolId);
if (parentToolName !== 'Task' && parentToolName !== 'Agent') return;

const msg = data.message as Record<string, unknown> | undefined;
if (!msg) return;
Expand Down