AI: How can we stream the edit_file tool when it generating like create_file ? Also the edit_file tool show this

"""Invalid File Edit

Could not extract the file changes from the tool result."""

Check the state of code base and make to sure implement fully
This commit is contained in:
LE Quoc Dat 2025-07-28 22:22:38 +02:00
parent d4619f0744
commit ef980353ba
2 changed files with 3 additions and 3 deletions

View File

@ -540,12 +540,12 @@ def authenticate_user(username, password):
await self.sandbox.fs.upload_file(new_content.encode(), full_path)
# Return rich data for frontend diff view
return self.success_response({
return ToolResult(success=True, output=json.dumps({
"message": f"File '{target_file}' edited successfully.",
"file_path": target_file,
"original_content": original_content,
"updated_content": new_content
})
}))
except Exception as e:
logger.error(f"Unhandled error in edit_file: {str(e)}", exc_info=True)

View File

@ -289,7 +289,7 @@ export const extractFileEditData = (
filePath: parsed.file_path || null,
originalContent: parsed.original_content ?? null,
updatedContent: parsed.updated_content ?? null,
success: true, // Assume success if we have content
success: parsed.updated_content !== null, // Success is false if updated_content is null
timestamp: null,
errorMessage: parsed.message,
};