mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-14 01:50:39 +09:00
fix: include toolName in tool_result transcript entries for Pi adapter
When tool_result entries arrive without a matching tool_call, the transcript was showing generic 'tool' as the name. Now pl-local parses toolName from tool_execution_end events and passes it through, so the UI can display the actual tool name (e.g., 'bash', 'Read', 'Ls') instead of 'tool'.
This commit is contained in:
parent
5536e6b91e
commit
aa854e7efe
3 changed files with 4 additions and 2 deletions
|
|
@ -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,
|
||||
}];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue