diff --git a/frontend/src/components/thread/content/ShowToolStream.tsx b/frontend/src/components/thread/content/ShowToolStream.tsx index 0decd71d..ce45aad3 100644 --- a/frontend/src/components/thread/content/ShowToolStream.tsx +++ b/frontend/src/components/thread/content/ShowToolStream.tsx @@ -45,11 +45,20 @@ export const ShowToolStream: React.FC = ({ // Extract code_edit content for streaming const codeEditContent = React.useMemo(() => { if (!isEditFile || !content) return ''; - const match = content.match(/([\s\S]*)/); - if (match) { - // Remove closing tag if present - return match[1].replace(/<\/code_edit>[\s\S]*$/, ''); + + // New regex for + const newMatch = content.match(/([\s\S]*)/i); + if (newMatch && newMatch[1]) { + // Remove closing tags if present + return newMatch[1].replace(/<\/parameter>[\s\S]*$/, ''); } + + // Fallback for old format + const oldMatch = content.match(/([\s\S]*)/i); + if (oldMatch && oldMatch[1]) { + return oldMatch[1].replace(/<\/code_edit>[\s\S]*$/, ''); + } + return ''; }, [content, isEditFile]); 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 f7aab248..f09c30d5 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 && (!originalContent || !updatedContent); + const shouldShowError = !isStreaming && !actualIsSuccess; return (