Commit 0f1b7fc

mo khan <mo@mokhan.ca>
2025-06-23 19:24:17
ask claude
1 parent 1c7cd5f
Changed files (1)
cmd
cmd/del/main.go
@@ -2025,9 +2025,9 @@ func (d *Del) parseTextToolCalls(input string) []ToolCall {
 	// File operations
 	if input == "list files" || input == "list the files" || input == "ls" {
 		calls = append(calls, ToolCall{Name: "list_dir", Args: map[string]interface{}{}})
-	} else if strings.HasPrefix(input, "read ") {
-		// Extract filename from input
-		filename := strings.TrimPrefix(input, "read ")
+	} else if strings.HasPrefix(strings.ToLower(originalInput), "read ") {
+		// Extract filename from original input to preserve case
+		filename := originalInput[5:] // Skip "read " or "Read " etc.
 		filename = strings.TrimSpace(filename)
 		if filename != "" {
 			calls = append(calls, ToolCall{Name: "read_file", Args: map[string]interface{}{"path": filename}})
@@ -2041,9 +2041,9 @@ func (d *Del) parseTextToolCalls(input string) []ToolCall {
 				"content": "# Content would need to be specified in a more sophisticated way",
 			}})
 		}
-	} else if strings.HasPrefix(input, "edit ") {
-		// Basic edit detection
-		filename := strings.TrimPrefix(input, "edit ")
+	} else if strings.HasPrefix(strings.ToLower(originalInput), "edit ") {
+		// Basic edit detection - preserve case in filename  
+		filename := originalInput[5:] // Skip "edit " or "Edit " etc.
 		filename = strings.TrimSpace(filename)
 		if filename != "" {
 			calls = append(calls, ToolCall{Name: "edit_file", Args: map[string]interface{}{
@@ -2118,8 +2118,8 @@ func (d *Del) parseTextToolCalls(input string) []ToolCall {
 		}
 		
 	// Notebook operations
-	} else if strings.HasPrefix(input, "read notebook ") {
-		notebook := strings.TrimPrefix(input, "read notebook ")
+	} else if strings.HasPrefix(strings.ToLower(originalInput), "read notebook ") {
+		notebook := originalInput[14:] // Skip "read notebook " or "Read Notebook " etc.
 		notebook = strings.TrimSpace(notebook)
 		if notebook != "" {
 			calls = append(calls, ToolCall{Name: "notebook_read", Args: map[string]interface{}{"notebook_path": notebook}})