Changesets · Branches · Tags · Compare
| Changeset | 9ea2d7361601b84614f5e031eba04a0a5ed97f145a9ec483ade8f74f5651aed3 |
|---|---|
| Author | Dallin Romney <dallinromney@gmail.com> · 2025-07-20 14:18 +02:00 |
| Committer | Dallin Romney <dallinromney@gmail.com> · 2025-07-20 14:18 +02:00 |
| Parents | a92cd8073012 |
1 file changed
modified gui/src/pages/gui/ToolCallDiv/FunctionSpecificToolCallDiv.tsx +12 −7
| @@ -18,25 +18,30 @@ | ||
| 18 | 18 | case BuiltInToolNames.CreateNewFile: |
| 19 | 19 | return ( |
| 20 | 20 | <CreateFile |
| 21 | - relativeFilepath={args.filepath} | |
| 22 | - fileContents={args.contents} | |
| 21 | + relativeFilepath={args?.filepath ?? ""} | |
| 22 | + fileContents={args?.contents ?? ""} | |
| 23 | 23 | historyIndex={historyIndex} |
| 24 | 24 | /> |
| 25 | 25 | ); |
| 26 | 26 | case BuiltInToolNames.EditExistingFile: |
| 27 | 27 | return ( |
| 28 | 28 | <EditFile |
| 29 | - relativeFilePath={args.filepath ?? ""} | |
| 30 | - changes={args.changes ?? ""} | |
| 29 | + relativeFilePath={args?.filepath ?? ""} | |
| 30 | + changes={args?.changes ?? ""} | |
| 31 | 31 | toolCallId={toolCall.id} |
| 32 | 32 | historyIndex={historyIndex} |
| 33 | 33 | /> |
| 34 | 34 | ); |
| 35 | 35 | case BuiltInToolNames.SearchAndReplaceInFile: |
| 36 | + const changes = args.diffs | |
| 37 | + ? Array.isArray(args.diffs) | |
| 38 | + ? args.diffs.join("\n\n---\n\n") | |
| 39 | + : args.diffs | |
| 40 | + : ""; | |
| 36 | 41 | return ( |
| 37 | 42 | <EditFile |
| 38 | - relativeFilePath={args.filepath ?? ""} | |
| 39 | - changes={args.diffs ? args.diffs.join("\n\n---\n\n") : ""} | |
| 43 | + relativeFilePath={args?.filepath ?? ""} | |
| 44 | + changes={changes} | |
| 40 | 45 | toolCallId={toolCall.id} |
| 41 | 46 | historyIndex={historyIndex} |
| 42 | 47 | /> |
| @@ -44,7 +49,7 @@ | ||
| 44 | 49 | case BuiltInToolNames.RunTerminalCommand: |
| 45 | 50 | return ( |
| 46 | 51 | <RunTerminalCommand |
| 47 | - command={args.command} | |
| 52 | + command={args?.command ?? ""} | |
| 48 | 53 | toolCallState={toolCallState} |
| 49 | 54 | toolCallId={toolCall.id} |
| 50 | 55 | /> |