diff options
| author | mo khan <mo@mokhan.ca> | 2025-06-23 13:24:17 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-06-23 13:24:17 -0600 |
| commit | 0f1b7fc2406c7ae31fe33cb264841e549aaf9adf (patch) | |
| tree | 5633f08b146fea68dd3914c84aa6b19fcc79c49c | |
| parent | 1c7cd5faea644cebb6340eaba12b6452631d6fab (diff) | |
ask claude
| -rw-r--r-- | cmd/del/main.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/cmd/del/main.go b/cmd/del/main.go index fcb8f16..a2c63aa 100644 --- a/cmd/del/main.go +++ b/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}}) |
