diff --git a/packages/adapter-utils/src/types.ts b/packages/adapter-utils/src/types.ts index f907d4b4..e7639593 100644 --- a/packages/adapter-utils/src/types.ts +++ b/packages/adapter-utils/src/types.ts @@ -246,7 +246,7 @@ export type TranscriptEntry = | { kind: "thinking"; ts: string; text: string; delta?: boolean } | { kind: "user"; ts: string; text: string } | { kind: "tool_call"; ts: string; name: string; input: unknown; toolUseId?: string } - | { kind: "tool_result"; ts: string; toolUseId: string; content: string; isError: boolean } + | { kind: "tool_result"; ts: string; toolUseId: string; toolName?: string; content: string; isError: boolean } | { kind: "init"; ts: string; model: string; sessionId: string } | { kind: "result"; ts: string; text: string; inputTokens: number; outputTokens: number; cachedTokens: number; costUsd: number; subtype: string; isError: boolean; errors: string[] } | { kind: "stderr"; ts: string; text: string } diff --git a/packages/adapters/pi-local/src/ui/parse-stdout.ts b/packages/adapters/pi-local/src/ui/parse-stdout.ts index b80fe5f1..7ded5633 100644 --- a/packages/adapters/pi-local/src/ui/parse-stdout.ts +++ b/packages/adapters/pi-local/src/ui/parse-stdout.ts @@ -130,6 +130,7 @@ export function parsePiStdoutLine(line: string, ts: string): TranscriptEntry[] { if (type === "tool_execution_end") { const toolCallId = asString(parsed.toolCallId); + const toolName = asString(parsed.toolName); const result = parsed.result; const isError = parsed.isError === true; const contentStr = typeof result === "string" ? result : JSON.stringify(result); @@ -138,6 +139,7 @@ export function parsePiStdoutLine(line: string, ts: string): TranscriptEntry[] { kind: "tool_result", ts, toolUseId: toolCallId || "unknown", + toolName, content: contentStr, isError, }]; diff --git a/ui/src/components/transcript/RunTranscriptView.tsx b/ui/src/components/transcript/RunTranscriptView.tsx index 5f42ec0e..cd52dbc1 100644 --- a/ui/src/components/transcript/RunTranscriptView.tsx +++ b/ui/src/components/transcript/RunTranscriptView.tsx @@ -400,7 +400,7 @@ export function normalizeTranscript(entries: TranscriptEntry[], streaming: boole type: "tool", ts: entry.ts, endTs: entry.ts, - name: "tool", + name: entry.toolName ?? "tool", toolUseId: entry.toolUseId, input: null, result: entry.content,