@@ -12,6 +12,7 @@ import (
12 "github.com/kujtimiihoxha/opencode/internal/config"
12 "github.com/kujtimiihoxha/opencode/internal/config"
13 "github.com/kujtimiihoxha/opencode/internal/diff"
13 "github.com/kujtimiihoxha/opencode/internal/diff"
14 "github.com/kujtimiihoxha/opencode/internal/history"
14 "github.com/kujtimiihoxha/opencode/internal/history"
15+ "github.com/kujtimiihoxha/opencode/internal/logging"
15 "github.com/kujtimiihoxha/opencode/internal/lsp"
16 "github.com/kujtimiihoxha/opencode/internal/lsp"
16 "github.com/kujtimiihoxha/opencode/internal/permission"
17 "github.com/kujtimiihoxha/opencode/internal/permission"
@@ -227,7 +228,7 @@ func (e *editTool) createNewFile(ctx context.Context, filePath, content string)
227 _, err = e.files.CreateVersion(ctx, sessionID, filePath, content)
228 _, err = e.files.CreateVersion(ctx, sessionID, filePath, content)
228 if err != nil {
229 if err != nil {
229 // Log error but don't fail the operation
230 // Log error but don't fail the operation
230− fmt.Printf("Error creating file history version: %v\n", err)
231+ logging.Debug("Error creating file history version", "error", err)
233 recordFileWrite(filePath)
234 recordFileWrite(filePath)
@@ -334,13 +335,13 @@ func (e *editTool) deleteContent(ctx context.Context, filePath, oldString string
334 // User Manually changed the content store an intermediate version
335 // User Manually changed the content store an intermediate version
335 _, err = e.files.CreateVersion(ctx, sessionID, filePath, oldContent)
336 _, err = e.files.CreateVersion(ctx, sessionID, filePath, oldContent)
336 if err != nil {
337 if err != nil {
337− fmt.Printf("Error creating file history version: %v\n", err)
338+ logging.Debug("Error creating file history version", "error", err)
340 // Store the new version
341 // Store the new version
341 _, err = e.files.CreateVersion(ctx, sessionID, filePath, "")
342 _, err = e.files.CreateVersion(ctx, sessionID, filePath, "")
342 if err != nil {
343 if err != nil {
343− fmt.Printf("Error creating file history version: %v\n", err)
344+ logging.Debug("Error creating file history version", "error", err)
346 recordFileWrite(filePath)
347 recordFileWrite(filePath)
@@ -448,13 +449,13 @@ func (e *editTool) replaceContent(ctx context.Context, filePath, oldString, newS
448 // User Manually changed the content store an intermediate version
449 // User Manually changed the content store an intermediate version
449 _, err = e.files.CreateVersion(ctx, sessionID, filePath, oldContent)
450 _, err = e.files.CreateVersion(ctx, sessionID, filePath, oldContent)
450 if err != nil {
451 if err != nil {
451− fmt.Printf("Error creating file history version: %v\n", err)
452+ logging.Debug("Error creating file history version", "error", err)
454 // Store the new version
455 // Store the new version
455 _, err = e.files.CreateVersion(ctx, sessionID, filePath, newContent)
456 _, err = e.files.CreateVersion(ctx, sessionID, filePath, newContent)
456 if err != nil {
457 if err != nil {
457− fmt.Printf("Error creating file history version: %v\n", err)
458+ logging.Debug("Error creating file history version", "error", err)
460 recordFileWrite(filePath)
461 recordFileWrite(filePath)