chore: swap error related logs to use error log level (#1505)

Adam Stringer created

Change summary

internal/agent/tools/edit.go      | 8 ++++----
internal/agent/tools/multiedit.go | 6 +++---
internal/agent/tools/write.go     | 4 ++--
internal/lsp/client.go            | 2 +-
4 files changed, 10 insertions(+), 10 deletions(-)

Detailed changes

internal/agent/tools/edit.go 🔗

@@ -163,7 +163,7 @@ func createNewFile(edit editContext, filePath, content string, call fantasy.Tool
 	_, err = edit.files.CreateVersion(edit.ctx, sessionID, filePath, content)
 	if err != nil {
 		// Log error but don't fail the operation
-		slog.Debug("Error creating file history version", "error", err)
+		slog.Error("Error creating file history version", "error", err)
 	}
 
 	recordFileWrite(filePath)
@@ -290,13 +290,13 @@ func deleteContent(edit editContext, filePath, oldString string, replaceAll bool
 		// User Manually changed the content store an intermediate version
 		_, err = edit.files.CreateVersion(edit.ctx, sessionID, filePath, oldContent)
 		if err != nil {
-			slog.Debug("Error creating file history version", "error", err)
+			slog.Error("Error creating file history version", "error", err)
 		}
 	}
 	// Store the new version
 	_, err = edit.files.CreateVersion(edit.ctx, sessionID, filePath, "")
 	if err != nil {
-		slog.Debug("Error creating file history version", "error", err)
+		slog.Error("Error creating file history version", "error", err)
 	}
 
 	recordFileWrite(filePath)
@@ -431,7 +431,7 @@ func replaceContent(edit editContext, filePath, oldString, newString string, rep
 	// Store the new version
 	_, err = edit.files.CreateVersion(edit.ctx, sessionID, filePath, newContent)
 	if err != nil {
-		slog.Debug("Error creating file history version", "error", err)
+		slog.Error("Error creating file history version", "error", err)
 	}
 
 	recordFileWrite(filePath)

internal/agent/tools/multiedit.go 🔗

@@ -196,7 +196,7 @@ func processMultiEditWithCreation(edit editContext, params MultiEditParams, call
 
 	_, err = edit.files.CreateVersion(edit.ctx, sessionID, params.FilePath, currentContent)
 	if err != nil {
-		slog.Debug("Error creating file history version", "error", err)
+		slog.Error("Error creating file history version", "error", err)
 	}
 
 	recordFileWrite(params.FilePath)
@@ -338,14 +338,14 @@ func processMultiEditExistingFile(edit editContext, params MultiEditParams, call
 		// User manually changed the content, store an intermediate version
 		_, err = edit.files.CreateVersion(edit.ctx, sessionID, params.FilePath, oldContent)
 		if err != nil {
-			slog.Debug("Error creating file history version", "error", err)
+			slog.Error("Error creating file history version", "error", err)
 		}
 	}
 
 	// Store the new version
 	_, err = edit.files.CreateVersion(edit.ctx, sessionID, params.FilePath, currentContent)
 	if err != nil {
-		slog.Debug("Error creating file history version", "error", err)
+		slog.Error("Error creating file history version", "error", err)
 	}
 
 	recordFileWrite(params.FilePath)

internal/agent/tools/write.go 🔗

@@ -147,13 +147,13 @@ func NewWriteTool(lspClients *csync.Map[string, *lsp.Client], permissions permis
 				// User Manually changed the content store an intermediate version
 				_, err = files.CreateVersion(ctx, sessionID, filePath, oldContent)
 				if err != nil {
-					slog.Debug("Error creating file history version", "error", err)
+					slog.Error("Error creating file history version", "error", err)
 				}
 			}
 			// Store the new version
 			_, err = files.CreateVersion(ctx, sessionID, filePath, params.Content)
 			if err != nil {
-				slog.Debug("Error creating file history version", "error", err)
+				slog.Error("Error creating file history version", "error", err)
 			}
 
 			recordFileWrite(filePath)

internal/lsp/client.go 🔗

@@ -417,7 +417,7 @@ func (c *Client) openKeyConfigFiles(ctx context.Context) {
 		if _, err := os.Stat(file); err == nil {
 			// File exists, try to open it
 			if err := c.OpenFile(ctx, file); err != nil {
-				slog.Debug("Failed to open key config file", "file", file, "error", err)
+				slog.Error("Failed to open key config file", "file", file, "error", err)
 			} else {
 				slog.Debug("Opened key config file for initialization", "file", file)
 			}