on main help sign in
fix(tools): standardize error message capitalization

view.go and write.go used capital 'Path is a directory' and 'File not found' while edit.go and multiedit.go used lowercase. Standardized all to lowercase to match Go error message conventions and the majority of existing messages.

commit83a2ded5b6d39bcfe9fc57e5f6279e71c7b60784 authoriko <mail@iko.soy> dateThu 9 Jul 2026, 03:23 (3 months ago) parenta9b1350
2 files changed+7−7
internal/agent/tools/view.go+4−4 internal/agent/tools/write.go+3−3
internal/agent/tools/view.go+4−4
@@ -177,19 +177,19 @@ func NewViewTool(
177177 }
178178
179179 if len(suggestions) > 0 {
180− return fantasy.NewTextErrorResponse(fmt.Sprintf("File not found: %s\n\nDid you mean one of these?\n%s",
180+ return fantasy.NewTextErrorResponse(fmt.Sprintf("file not found: %s\n\nDid you mean one of these?\n%s",
181181 filePath, strings.Join(suggestions, "\n"))), nil
182182 }
183183 }
184184
185− return fantasy.NewTextErrorResponse(fmt.Sprintf("File not found: %s", filePath)), nil
185+ return fantasy.NewTextErrorResponse(fmt.Sprintf("file not found: %s", filePath)), nil
186186 }
187187 return fantasy.ToolResponse{}, fmt.Errorf("error accessing file: %w", err)
188188 }
189189
190190 // Check if it's a directory
191191 if fileInfo.IsDir() {
192− return fantasy.NewTextErrorResponse(fmt.Sprintf("Path is a directory, not a file: %s", filePath)), nil
192+ return fantasy.NewTextErrorResponse(fmt.Sprintf("path is a directory, not a file: %s", filePath)), nil
193193 }
194194
195195 // Set default limit if not provided (no limit for SKILL.md files)
@@ -448,7 +448,7 @@ func readBuiltinFile(params ViewParams, skillTracker *skills.Tracker) (fantasy.T
448448
449449 data, err := fs.ReadFile(builtinFS, embeddedPath)
450450 if err != nil {
451− return fantasy.NewTextErrorResponse(fmt.Sprintf("Builtin file not found: %s", params.FilePath)), nil
451+ return fantasy.NewTextErrorResponse(fmt.Sprintf("builtin file not found: %s", params.FilePath)), nil
452452 }
453453
454454 content := string(data)
internal/agent/tools/write.go+3−3
@@ -69,13 +69,13 @@ func NewWriteTool(
6969 oldContent := ""
7070 if err == nil {
7171 if fileInfo.IsDir() {
72− return fantasy.NewTextErrorResponse(fmt.Sprintf("Path is a directory, not a file: %s", filePath)), nil
72+ return fantasy.NewTextErrorResponse(fmt.Sprintf("path is a directory, not a file: %s", filePath)), nil
7373 }
7474
7575 modTime := fileInfo.ModTime().Truncate(time.Second)
7676 lastRead := filetracker.LastReadTime(ctx, sessionID, filePath)
7777 if modTime.After(lastRead) {
78− return fantasy.NewTextErrorResponse(fmt.Sprintf("File %s has been modified since it was last read.\nLast modification: %s\nLast read: %s\n\nPlease read the file again before modifying it.",
78+ return fantasy.NewTextErrorResponse(fmt.Sprintf("file %s has been modified since it was last read.\nLast modification: %s\nLast read: %s\n\nPlease read the file again before modifying it.",
7979 filePath, modTime.Format(time.RFC3339), lastRead.Format(time.RFC3339))), nil
8080 }
8181
@@ -83,7 +83,7 @@ func NewWriteTool(
8383 if readErr == nil {
8484 oldContent = string(oldBytes)
8585 if oldContent == params.Content {
86− return fantasy.NewTextErrorResponse(fmt.Sprintf("File %s already contains the exact content. No changes made.", filePath)), nil
86+ return fantasy.NewTextErrorResponse(fmt.Sprintf("file %s already contains the exact content. No changes made.", filePath)), nil
8787 }
8888 }
8989 } else if !os.IsNotExist(err) {