docs/plans/2026-03-22-agent-tool-display-design.md
For Claude: REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
Goal: Add a dedicated VSCode/web UI display for Agent tool executions so subagent progress, summaries, and failures render from structured rawOutput instead of falling back to the generic tool card.
Architecture: Preserve ACP rawOutput through the VSCode session/update pipeline into ToolCallData, then let the shared web UI router detect task_execution payloads and render a dedicated AgentToolCall component. Keep the change shared in packages/webui so VSCode and ChatViewer stay aligned.
Tech Stack: TypeScript, React, Vitest, shared @qwen-code/webui tool-call components.
Files:
packages/vscode-ide-companion/src/services/qwenSessionUpdateHandler.test.tspackages/vscode-ide-companion/src/webview/hooks/useToolCalls.test.tsxStep 1: Write the failing tests
tool_call_update forwards rawOutput when ACP sends a task_execution payload.useToolCalls stores and updates rawOutput for an agent tool call.Step 2: Run test to verify it fails
Run: npm test --workspace=packages/vscode-ide-companion -- --run qwenSessionUpdateHandler.test.ts useToolCalls.test.tsx
Expected: failures because rawOutput is not preserved in the current handler/hook pipeline.
Files:
packages/vscode-ide-companion/src/webview/components/messages/toolcalls/index.test.tsxStep 1: Write the failing test
kind: 'other' plus rawOutput.type === 'task_execution'.Step 2: Run test to verify it fails
Run: npm test --workspace=packages/vscode-ide-companion -- --run packages/vscode-ide-companion/src/webview/components/messages/toolcalls/index.test.tsx
Expected: failure because the router only keys off kind and no dedicated agent component exists.
Files:
packages/vscode-ide-companion/src/types/chatTypes.tspackages/vscode-ide-companion/src/services/qwenSessionUpdateHandler.tspackages/vscode-ide-companion/src/webview/hooks/useToolCalls.tspackages/webui/src/components/toolcalls/shared/types.tsStep 1: Implement the minimal data model changes
rawOutput to the VSCode session/webview tool-call types.rawOutput in QwenSessionUpdateHandler.rawOutput in useToolCalls.rawOutput in shared web UI tool-call data types.Step 2: Run the focused tests
Run: npm test --workspace=packages/vscode-ide-companion -- --run qwenSessionUpdateHandler.test.ts useToolCalls.test.tsx
Expected: pass.
Files:
packages/webui/src/components/toolcalls/AgentToolCall.tsxpackages/webui/src/components/toolcalls/index.tspackages/vscode-ide-companion/src/webview/components/messages/toolcalls/index.tsxpackages/webui/src/components/ChatViewer/ChatViewer.tsxStep 1: Implement the minimal renderer
rawOutput.type === 'task_execution'.Step 2: Run the focused renderer test
Run: npm test --workspace=packages/vscode-ide-companion -- --run packages/vscode-ide-companion/src/webview/components/messages/toolcalls/index.test.tsx
Expected: pass.
Files:
packages/webui/src/index.tsStep 1: Export the new shared component if needed
ChatViewer.Step 2: Run package verification
Run: npm test --workspace=packages/vscode-ide-companion -- --run qwenSessionUpdateHandler.test.ts useToolCalls.test.tsx packages/vscode-ide-companion/src/webview/components/messages/toolcalls/index.test.tsx
Run: npm run check-types --workspace=packages/vscode-ide-companion
Run: npm run typecheck --workspace=packages/webui
Expected: all targeted tests and typechecks pass.