diff --git a/frontend/src/components/thread/tool-views/file-operation/FileEditToolView.tsx b/frontend/src/components/thread/tool-views/file-operation/FileEditToolView.tsx index 849248f3..e7953260 100644 --- a/frontend/src/components/thread/tool-views/file-operation/FileEditToolView.tsx +++ b/frontend/src/components/thread/tool-views/file-operation/FileEditToolView.tsx @@ -142,7 +142,7 @@ export function FileEditToolView({ const lineDiff = originalContent && updatedContent ? generateLineDiff(originalContent, updatedContent) : []; const stats: DiffStats = calculateDiffStats(lineDiff); - const shouldShowError = !isStreaming && (!actualIsSuccess || (actualIsSuccess && (!originalContent || !updatedContent))); + const shouldShowError = !isStreaming && (!actualIsSuccess || (actualIsSuccess && (originalContent === null || updatedContent === null))); return ( diff --git a/frontend/src/components/thread/tool-views/file-operation/_utils.ts b/frontend/src/components/thread/tool-views/file-operation/_utils.ts index 717c7877..335430f4 100644 --- a/frontend/src/components/thread/tool-views/file-operation/_utils.ts +++ b/frontend/src/components/thread/tool-views/file-operation/_utils.ts @@ -265,8 +265,8 @@ export const extractFileEditData = ( const success = parsed.tool_execution.result?.success; return { filePath: args.target_file || output?.file_path || null, - originalContent: output?.original_content || null, - updatedContent: output?.updated_content || null, + originalContent: output?.original_content ?? null, + updatedContent: output?.updated_content ?? null, success: success, timestamp: parsed.tool_execution.execution_details?.timestamp, errorMessage: success === false ? (output?.message || (typeof output === 'string' ? output : JSON.stringify(output))) : undefined,