on main help sign in
chore: swap error related logs to use error log level (#1505)
commita34a8a3291fb8db97903acc43b3a136c75d5def8 authorAdam Stringer <adamstringer@hey.com> dateMon 24 Nov 2025, 12:05 (1 year ago) parentdac33ca
4 files changed+10−10
internal/agent/tools/edit.go+4−4 internal/agent/tools/multiedit.go+3−3 internal/agent/tools/write.go+2−2 internal/lsp/client.go+1−1
internal/agent/tools/edit.go+4−4
@@ -163,7 +163,7 @@ func createNewFile(edit editContext, filePath, content string, call fantasy.Tool
163163 _, err = edit.files.CreateVersion(edit.ctx, sessionID, filePath, content)
164164 if err != nil {
165165 // Log error but don't fail the operation
166− slog.Debug("Error creating file history version", "error", err)
166+ slog.Error("Error creating file history version", "error", err)
167167 }
168168
169169 recordFileWrite(filePath)
@@ -290,13 +290,13 @@ func deleteContent(edit editContext, filePath, oldString string, replaceAll bool
290290 // User Manually changed the content store an intermediate version
291291 _, err = edit.files.CreateVersion(edit.ctx, sessionID, filePath, oldContent)
292292 if err != nil {
293− slog.Debug("Error creating file history version", "error", err)
293+ slog.Error("Error creating file history version", "error", err)
294294 }
295295 }
296296 // Store the new version
297297 _, err = edit.files.CreateVersion(edit.ctx, sessionID, filePath, "")
298298 if err != nil {
299− slog.Debug("Error creating file history version", "error", err)
299+ slog.Error("Error creating file history version", "error", err)
300300 }
301301
302302 recordFileWrite(filePath)
@@ -431,7 +431,7 @@ func replaceContent(edit editContext, filePath, oldString, newString string, rep
431431 // Store the new version
432432 _, err = edit.files.CreateVersion(edit.ctx, sessionID, filePath, newContent)
433433 if err != nil {
434− slog.Debug("Error creating file history version", "error", err)
434+ slog.Error("Error creating file history version", "error", err)
435435 }
436436
437437 recordFileWrite(filePath)
internal/agent/tools/multiedit.go+3−3
@@ -196,7 +196,7 @@ func processMultiEditWithCreation(edit editContext, params MultiEditParams, call
196196
197197 _, err = edit.files.CreateVersion(edit.ctx, sessionID, params.FilePath, currentContent)
198198 if err != nil {
199− slog.Debug("Error creating file history version", "error", err)
199+ slog.Error("Error creating file history version", "error", err)
200200 }
201201
202202 recordFileWrite(params.FilePath)
@@ -338,14 +338,14 @@ func processMultiEditExistingFile(edit editContext, params MultiEditParams, call
338338 // User manually changed the content, store an intermediate version
339339 _, err = edit.files.CreateVersion(edit.ctx, sessionID, params.FilePath, oldContent)
340340 if err != nil {
341− slog.Debug("Error creating file history version", "error", err)
341+ slog.Error("Error creating file history version", "error", err)
342342 }
343343 }
344344
345345 // Store the new version
346346 _, err = edit.files.CreateVersion(edit.ctx, sessionID, params.FilePath, currentContent)
347347 if err != nil {
348− slog.Debug("Error creating file history version", "error", err)
348+ slog.Error("Error creating file history version", "error", err)
349349 }
350350
351351 recordFileWrite(params.FilePath)
internal/agent/tools/write.go+2−2
@@ -147,13 +147,13 @@ func NewWriteTool(lspClients *csync.Map[string, *lsp.Client], permissions permis
147147 // User Manually changed the content store an intermediate version
148148 _, err = files.CreateVersion(ctx, sessionID, filePath, oldContent)
149149 if err != nil {
150− slog.Debug("Error creating file history version", "error", err)
150+ slog.Error("Error creating file history version", "error", err)
151151 }
152152 }
153153 // Store the new version
154154 _, err = files.CreateVersion(ctx, sessionID, filePath, params.Content)
155155 if err != nil {
156− slog.Debug("Error creating file history version", "error", err)
156+ slog.Error("Error creating file history version", "error", err)
157157 }
158158
159159 recordFileWrite(filePath)
internal/lsp/client.go+1−1
@@ -417,7 +417,7 @@ func (c *Client) openKeyConfigFiles(ctx context.Context) {
417417 if _, err := os.Stat(file); err == nil {
418418 // File exists, try to open it
419419 if err := c.OpenFile(ctx, file); err != nil {
420− slog.Debug("Failed to open key config file", "file", file, "error", err)
420+ slog.Error("Failed to open key config file", "file", file, "error", err)
421421 } else {
422422 slog.Debug("Opened key config file for initialization", "file", file)
423423 }