fix: handle args for function specific tool call divs

This commit is contained in:
Dallin Romney 2025-07-20 14:18:21 +02:00
parent 6af35548c8
commit ae29787bd2

View file

@ -18,25 +18,30 @@ function FunctionSpecificToolCallDiv({
case BuiltInToolNames.CreateNewFile:
return (
<CreateFile
relativeFilepath={args.filepath}
fileContents={args.contents}
relativeFilepath={args?.filepath ?? ""}
fileContents={args?.contents ?? ""}
historyIndex={historyIndex}
/>
);
case BuiltInToolNames.EditExistingFile:
return (
<EditFile
relativeFilePath={args.filepath ?? ""}
changes={args.changes ?? ""}
relativeFilePath={args?.filepath ?? ""}
changes={args?.changes ?? ""}
toolCallId={toolCall.id}
historyIndex={historyIndex}
/>
);
case BuiltInToolNames.SearchAndReplaceInFile:
const changes = args.diffs
? Array.isArray(args.diffs)
? args.diffs.join("\n\n---\n\n")
: args.diffs
: "";
return (
<EditFile
relativeFilePath={args.filepath ?? ""}
changes={args.diffs ? args.diffs.join("\n\n---\n\n") : ""}
relativeFilePath={args?.filepath ?? ""}
changes={changes}
toolCallId={toolCall.id}
historyIndex={historyIndex}
/>
@ -44,7 +49,7 @@ function FunctionSpecificToolCallDiv({
case BuiltInToolNames.RunTerminalCommand:
return (
<RunTerminalCommand
command={args.command}
command={args?.command ?? ""}
toolCallState={toolCallState}
toolCallId={toolCall.id}
/>