fix: Remove check empty file for edit tool

This commit is contained in:
Petr Mironychev
2025-11-03 18:06:51 +01:00
parent a2f3ae4f64
commit 6ff6901421
2 changed files with 2 additions and 9 deletions

View File

@ -701,14 +701,6 @@ bool ChangesManager::performFragmentReplacement(
bool isUndo)
{
QString currentContent = readFileContent(filePath);
if (currentContent.isNull()) {
if (errorMsg) {
*errorMsg = "Failed to read current file content";
}
LOG_MESSAGE(QString("Failed to read file for fragment replacement: %1").arg(filePath));
return false;
}
QString resultContent;
if (isAppendOperation) {

View File

@ -56,10 +56,11 @@ QString EditFileTool::description() const
"and new_content to replace it with. Changes are applied immediately if auto-apply "
"is enabled in settings. The user can undo or reapply changes at any time. "
"\n\nIMPORTANT:"
"\n- For EMPTY files: use empty old_content (empty string or omit parameter)."
"\n- To append at the END of file: use empty old_content."
"\n- To insert at the BEGINNING of a file (e.g., copyright header), you MUST provide "
"the EXACT first few lines of the file as old_content (at least 3-5 lines), "
"then put those lines + new header in new_content."
"\n- To append at the END of file, use empty old_content."
"\n- For replacements in the middle, provide EXACT matching text with sufficient "
"context (at least 5-10 lines) to ensure correct placement."
"\n- The system requires 85% similarity for first-time edits. Provide accurate "