Chore: linter complaints

This commit is contained in:
Grail Finder
2026-03-15 11:50:22 +03:00
parent 7e346b5e19
commit e476575334
7 changed files with 66 additions and 77 deletions

View File

@@ -57,15 +57,12 @@ func (a *PWAgent) setToolCallOnLastMessage(resp []byte, toolCallID string) {
if toolCallID == "" { if toolCallID == "" {
return return
} }
var genericResp map[string]interface{} var genericResp map[string]interface{}
if err := json.Unmarshal(resp, &genericResp); err != nil { if err := json.Unmarshal(resp, &genericResp); err != nil {
return return
} }
var name string var name string
var args map[string]string var args map[string]string
if choices, ok := genericResp["choices"].([]interface{}); ok && len(choices) > 0 { if choices, ok := genericResp["choices"].([]interface{}); ok && len(choices) > 0 {
if firstChoice, ok := choices[0].(map[string]interface{}); ok { if firstChoice, ok := choices[0].(map[string]interface{}); ok {
if message, ok := firstChoice["message"].(map[string]interface{}); ok { if message, ok := firstChoice["message"].(map[string]interface{}); ok {
@@ -74,19 +71,17 @@ func (a *PWAgent) setToolCallOnLastMessage(resp []byte, toolCallID string) {
if fn, ok := tc["function"].(map[string]interface{}); ok { if fn, ok := tc["function"].(map[string]interface{}); ok {
name, _ = fn["name"].(string) name, _ = fn["name"].(string)
argsStr, _ := fn["arguments"].(string) argsStr, _ := fn["arguments"].(string)
json.Unmarshal([]byte(argsStr), &args) _ = json.Unmarshal([]byte(argsStr), &args)
} }
} }
} }
} }
} }
} }
if name == "" { if name == "" {
content, _ := genericResp["content"].(string) content, _ := genericResp["content"].(string)
name = extractToolNameFromText(content) name = extractToolNameFromText(content)
} }
lastIdx := len(a.chatBody.Messages) - 1 lastIdx := len(a.chatBody.Messages) - 1
if lastIdx >= 0 { if lastIdx >= 0 {
a.chatBody.Messages[lastIdx].ToolCallID = toolCallID a.chatBody.Messages[lastIdx].ToolCallID = toolCallID
@@ -110,14 +105,12 @@ func extractToolNameFromText(text string) string {
jsStr = strings.TrimPrefix(jsStr, "__tool_call__") jsStr = strings.TrimPrefix(jsStr, "__tool_call__")
jsStr = strings.TrimSuffix(jsStr, "__tool_call__") jsStr = strings.TrimSuffix(jsStr, "__tool_call__")
jsStr = strings.TrimSpace(jsStr) jsStr = strings.TrimSpace(jsStr)
start := strings.Index(jsStr, "{") start := strings.Index(jsStr, "{")
end := strings.LastIndex(jsStr, "}") end := strings.LastIndex(jsStr, "}")
if start == -1 || end == -1 || end <= start { if start == -1 || end == -1 || end <= start {
return "" return ""
} }
jsStr = jsStr[start : end+1] jsStr = jsStr[start : end+1]
var fc models.FuncCall var fc models.FuncCall
if err := json.Unmarshal([]byte(jsStr), &fc); err != nil { if err := json.Unmarshal([]byte(jsStr), &fc); err != nil {
return "" return ""

View File

@@ -4,6 +4,7 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"regexp" "regexp"
"strconv"
"strings" "strings"
"gf-lt/models" "gf-lt/models"
@@ -252,7 +253,6 @@ func findToolCall(resp []byte) (func() []byte, string, bool) {
if err := json.Unmarshal(resp, &genericResp); err != nil { if err := json.Unmarshal(resp, &genericResp); err != nil {
return findToolCallFromText(string(resp)) return findToolCallFromText(string(resp))
} }
if choices, ok := genericResp["choices"].([]interface{}); ok && len(choices) > 0 { if choices, ok := genericResp["choices"].([]interface{}); ok && len(choices) > 0 {
if firstChoice, ok := choices[0].(map[string]interface{}); ok { if firstChoice, ok := choices[0].(map[string]interface{}); ok {
if message, ok := firstChoice["message"].(map[string]interface{}); ok { if message, ok := firstChoice["message"].(map[string]interface{}); ok {
@@ -268,11 +268,9 @@ func findToolCall(resp []byte) (func() []byte, string, bool) {
} }
} }
} }
if content, ok := genericResp["content"].(string); ok { if content, ok := genericResp["content"].(string); ok {
return findToolCallFromText(content) return findToolCallFromText(content)
} }
return findToolCallFromText(string(resp)) return findToolCallFromText(string(resp))
} }
@@ -280,20 +278,17 @@ func parseOpenAIToolCall(toolCalls []interface{}) (func() []byte, string, bool)
if len(toolCalls) == 0 { if len(toolCalls) == 0 {
return nil, "", false return nil, "", false
} }
tc := toolCalls[0].(map[string]interface{}) tc := toolCalls[0].(map[string]interface{})
id, _ := tc["id"].(string) id, _ := tc["id"].(string)
function, _ := tc["function"].(map[string]interface{}) function, _ := tc["function"].(map[string]interface{})
name, _ := function["name"].(string) name, _ := function["name"].(string)
argsStr, _ := function["arguments"].(string) argsStr, _ := function["arguments"].(string)
var args map[string]string var args map[string]string
if err := json.Unmarshal([]byte(argsStr), &args); err != nil { if err := json.Unmarshal([]byte(argsStr), &args); err != nil {
return func() []byte { return func() []byte {
return []byte(fmt.Sprintf(`{"error": "failed to parse arguments: %v"}`, err)) return []byte(fmt.Sprintf(`{"error": "failed to parse arguments: %v"}`, err))
}, id, true }, id, true
} }
return func() []byte { return func() []byte {
fn, ok := pwToolMap[name] fn, ok := pwToolMap[name]
if !ok { if !ok {
@@ -308,12 +303,10 @@ func findToolCallFromText(text string) (func() []byte, string, bool) {
if jsStr == "" { if jsStr == "" {
return nil, "", false return nil, "", false
} }
jsStr = strings.TrimSpace(jsStr) jsStr = strings.TrimSpace(jsStr)
jsStr = strings.TrimPrefix(jsStr, "__tool_call__") jsStr = strings.TrimPrefix(jsStr, "__tool_call__")
jsStr = strings.TrimSuffix(jsStr, "__tool_call__") jsStr = strings.TrimSuffix(jsStr, "__tool_call__")
jsStr = strings.TrimSpace(jsStr) jsStr = strings.TrimSpace(jsStr)
start := strings.Index(jsStr, "{") start := strings.Index(jsStr, "{")
end := strings.LastIndex(jsStr, "}") end := strings.LastIndex(jsStr, "}")
if start == -1 || end == -1 || end <= start { if start == -1 || end == -1 || end <= start {
@@ -321,20 +314,16 @@ func findToolCallFromText(text string) (func() []byte, string, bool) {
return []byte(`{"error": "no valid JSON found in tool call"}`) return []byte(`{"error": "no valid JSON found in tool call"}`)
}, "", true }, "", true
} }
jsStr = jsStr[start : end+1] jsStr = jsStr[start : end+1]
var fc models.FuncCall var fc models.FuncCall
if err := json.Unmarshal([]byte(jsStr), &fc); err != nil { if err := json.Unmarshal([]byte(jsStr), &fc); err != nil {
return func() []byte { return func() []byte {
return []byte(fmt.Sprintf(`{"error": "failed to parse tool call: %v}`, err)) return []byte(fmt.Sprintf(`{"error": "failed to parse tool call: %v}`, err))
}, "", true }, "", true
} }
if fc.ID == "" { if fc.ID == "" {
fc.ID = "call_" + generateToolCallID() fc.ID = "call_" + generateToolCallID()
} }
return func() []byte { return func() []byte {
fn, ok := pwToolMap[fc.Name] fn, ok := pwToolMap[fc.Name]
if !ok { if !ok {
@@ -345,5 +334,5 @@ func findToolCallFromText(text string) (func() []byte, string, bool) {
} }
func generateToolCallID() string { func generateToolCallID() string {
return fmt.Sprintf("%d", len(pwToolMap)%10000) return strconv.Itoa(len(pwToolMap) % 10000)
} }

View File

@@ -52,6 +52,7 @@ func (d dummyStore) ChatGetMaxID() (uint32, error) { ret
func (d dummyStore) Memorise(m *models.Memory) (*models.Memory, error) { return m, nil } func (d dummyStore) Memorise(m *models.Memory) (*models.Memory, error) { return m, nil }
func (d dummyStore) Recall(agent, topic string) (string, error) { return "", nil } func (d dummyStore) Recall(agent, topic string) (string, error) { return "", nil }
func (d dummyStore) RecallTopics(agent string) ([]string, error) { return nil, nil } func (d dummyStore) RecallTopics(agent string) ([]string, error) { return nil, nil }
func (d dummyStore) Forget(agent, topic string) error { return nil }
// VectorRepo methods (not used but required by interface) // VectorRepo methods (not used but required by interface)
func (d dummyStore) WriteVector(row *models.VectorRow) error { return nil } func (d dummyStore) WriteVector(row *models.VectorRow) error { return nil }

View File

@@ -1,10 +1,12 @@
package tools package tools
import ( import (
"errors"
"fmt" "fmt"
"os" "os"
"os/exec" "os/exec"
"path/filepath" "path/filepath"
"strconv"
"strings" "strings"
) )
@@ -143,7 +145,7 @@ func ExecChain(command string) string {
func execSingle(command, stdin string) (string, error) { func execSingle(command, stdin string) (string, error) {
parts := tokenize(command) parts := tokenize(command)
if len(parts) == 0 { if len(parts) == 0 {
return "", fmt.Errorf("empty command") return "", errors.New("empty command")
} }
name := parts[0] name := parts[0]
args := parts[1:] args := parts[1:]
@@ -243,10 +245,10 @@ func execBuiltin(name string, args []string, stdin string) string {
return fmt.Sprintf("[error] cd: %v", err) return fmt.Sprintf("[error] cd: %v", err)
} }
if !info.IsDir() { if !info.IsDir() {
return fmt.Sprintf("[error] cd: not a directory: %s", dir) return "[error] cd: not a directory: " + dir
} }
cfg.FilePickerDir = abs cfg.FilePickerDir = abs
return fmt.Sprintf("Changed directory to: %s", cfg.FilePickerDir) return "Changed directory to: " + cfg.FilePickerDir
case "mkdir": case "mkdir":
if len(args) == 0 { if len(args) == 0 {
return "[error] usage: mkdir [-p] <dir>" return "[error] usage: mkdir [-p] <dir>"
@@ -278,9 +280,9 @@ func execBuiltin(name string, args []string, stdin string) string {
return fmt.Sprintf("[error] mkdir: %v", err) return fmt.Sprintf("[error] mkdir: %v", err)
} }
if createParents { if createParents {
return fmt.Sprintf("Created %s (with parents)", dirPath) return "Created " + dirPath + " (with parents)"
} }
return fmt.Sprintf("Created %s", dirPath) return "Created " + dirPath
case "ls": case "ls":
dir := "." dir := "."
for _, a := range args { for _, a := range args {
@@ -300,16 +302,17 @@ func execBuiltin(name string, args []string, stdin string) string {
var out strings.Builder var out strings.Builder
for _, e := range entries { for _, e := range entries {
info, _ := e.Info() info, _ := e.Info()
if e.IsDir() { switch {
case e.IsDir():
fmt.Fprintf(&out, "d %-8s %s/\n", "-", e.Name()) fmt.Fprintf(&out, "d %-8s %s/\n", "-", e.Name())
} else if info != nil { case info != nil:
size := info.Size() size := info.Size()
sizeStr := fmt.Sprintf("%d", size) sizeStr := strconv.FormatInt(size, 10)
if size > 1024 { if size > 1024 {
sizeStr = fmt.Sprintf("%.1fKB", float64(size)/1024) sizeStr = fmt.Sprintf("%.1fKB", float64(size)/1024)
} }
fmt.Fprintf(&out, "f %-8s %s\n", sizeStr, e.Name()) fmt.Fprintf(&out, "f %-8s %s\n", sizeStr, e.Name())
} else { default:
fmt.Fprintf(&out, "f %-8s %s\n", "?", e.Name()) fmt.Fprintf(&out, "f %-8s %s\n", "?", e.Name())
} }
} }

View File

@@ -3,6 +3,7 @@ package tools
import ( import (
"encoding/base64" "encoding/base64"
"encoding/json" "encoding/json"
"errors"
"fmt" "fmt"
"gf-lt/models" "gf-lt/models"
"os" "os"
@@ -30,6 +31,9 @@ func SetMemoryStore(store MemoryStore, role string) {
} }
func SetFSRoot(dir string) { func SetFSRoot(dir string) {
if cfg == nil {
return
}
cfg.FilePickerDir = dir cfg.FilePickerDir = dir
} }
@@ -55,7 +59,7 @@ func SetFSCwd(dir string) error {
func resolvePath(rel string) (string, error) { func resolvePath(rel string) (string, error) {
if cfg.FilePickerDir == "" { if cfg.FilePickerDir == "" {
return "", fmt.Errorf("fs root not set") return "", errors.New("fs root not set")
} }
if filepath.IsAbs(rel) { if filepath.IsAbs(rel) {
abs := filepath.Clean(rel) abs := filepath.Clean(rel)
@@ -104,11 +108,12 @@ func FsLs(args []string, stdin string) string {
var out strings.Builder var out strings.Builder
for _, e := range entries { for _, e := range entries {
info, _ := e.Info() info, _ := e.Info()
if e.IsDir() { switch {
case e.IsDir():
fmt.Fprintf(&out, "d %-8s %s/\n", "-", e.Name()) fmt.Fprintf(&out, "d %-8s %s/\n", "-", e.Name())
} else if info != nil { case info != nil:
fmt.Fprintf(&out, "f %-8s %s\n", humanSize(info.Size()), e.Name()) fmt.Fprintf(&out, "f %-8s %s\n", humanSize(info.Size()), e.Name())
} else { default:
fmt.Fprintf(&out, "f %-8s %s\n", "?", e.Name()) fmt.Fprintf(&out, "f %-8s %s\n", "?", e.Name())
} }
} }
@@ -198,14 +203,17 @@ func FsWrite(args []string, stdin string) string {
var path string var path string
var contentParts []string var contentParts []string
for _, a := range args { for _, a := range args {
if a == "-b" || a == "--base64" { switch a {
case "-b", "--base64":
b64 = true b64 = true
} else if path == "" { default:
if path == "" {
path = a path = a
} else { } else {
contentParts = append(contentParts, a) contentParts = append(contentParts, a)
} }
} }
}
if path == "" { if path == "" {
return "[error] usage: write <path> [content] or pipe stdin" return "[error] usage: write <path> [content] or pipe stdin"
} }
@@ -296,7 +304,7 @@ func FsRm(args []string, stdin string) string {
if err := os.RemoveAll(abs); err != nil { if err := os.RemoveAll(abs); err != nil {
return fmt.Sprintf("[error] rm: %v", err) return fmt.Sprintf("[error] rm: %v", err)
} }
return fmt.Sprintf("Removed %s", args[0]) return "Removed " + args[0]
} }
func FsCp(args []string, stdin string) string { func FsCp(args []string, stdin string) string {
@@ -375,9 +383,9 @@ func FsMkdir(args []string, stdin string) string {
return fmt.Sprintf("[error] mkdir: %v", err) return fmt.Sprintf("[error] mkdir: %v", err)
} }
if createParents { if createParents {
return fmt.Sprintf("Created %s (with parents)", dirPath) return "Created " + dirPath + " (with parents)"
} }
return fmt.Sprintf("Created %s", dirPath) return "Created " + dirPath
} }
// Text processing commands // Text processing commands
@@ -435,7 +443,7 @@ func FsGrep(args []string, stdin string) string {
} }
} }
if countOnly { if countOnly {
return fmt.Sprintf("%d", len(matched)) return strconv.Itoa(len(matched))
} }
return strings.Join(matched, "\n") return strings.Join(matched, "\n")
} }
@@ -487,11 +495,11 @@ func FsWc(args []string, stdin string) string {
if len(args) > 0 { if len(args) > 0 {
switch args[0] { switch args[0] {
case "-l": case "-l":
return fmt.Sprintf("%d", lines) return strconv.Itoa(lines)
case "-w": case "-w":
return fmt.Sprintf("%d", words) return strconv.Itoa(words)
case "-c": case "-c":
return fmt.Sprintf("%d", chars) return strconv.Itoa(chars)
} }
} }
return fmt.Sprintf("%d lines, %d words, %d chars", lines, words, chars) return fmt.Sprintf("%d lines, %d words, %d chars", lines, words, chars)
@@ -502,9 +510,10 @@ func FsSort(args []string, stdin string) string {
reverse := false reverse := false
numeric := false numeric := false
for _, a := range args { for _, a := range args {
if a == "-r" { switch a {
case "-r":
reverse = true reverse = true
} else if a == "-n" { case "-n":
numeric = true numeric = true
} }
} }
@@ -615,10 +624,10 @@ func FsCd(args []string, stdin string) string {
return fmt.Sprintf("[error] cd: %v", err) return fmt.Sprintf("[error] cd: %v", err)
} }
if !info.IsDir() { if !info.IsDir() {
return fmt.Sprintf("[error] cd: not a directory: %s", dir) return "[error] cd: not a directory: " + dir
} }
cfg.FilePickerDir = abs cfg.FilePickerDir = abs
return fmt.Sprintf("Changed directory to: %s", cfg.FilePickerDir) return "Changed directory to: " + cfg.FilePickerDir
} }
func FsSed(args []string, stdin string) string { func FsSed(args []string, stdin string) string {
@@ -629,15 +638,17 @@ func FsSed(args []string, stdin string) string {
var filePath string var filePath string
var pattern string var pattern string
for _, a := range args { for _, a := range args {
if a == "-i" || a == "--in-place" { switch a {
case "-i", "--in-place":
inPlace = true inPlace = true
} else if strings.HasPrefix(a, "s") && len(a) > 1 { default:
// This looks like a sed pattern if strings.HasPrefix(a, "s") && len(a) > 1 {
pattern = a pattern = a
} else if filePath == "" && !strings.HasPrefix(a, "-") { } else if filePath == "" && !strings.HasPrefix(a, "-") {
filePath = a filePath = a
} }
} }
}
if pattern == "" { if pattern == "" {
return "[error] usage: sed 's/old/new/[g]' [file]" return "[error] usage: sed 's/old/new/[g]' [file]"
} }
@@ -650,8 +661,8 @@ func FsSed(args []string, stdin string) string {
newStr := parts[1] newStr := parts[1]
global := len(parts) >= 3 && strings.Contains(parts[2], "g") global := len(parts) >= 3 && strings.Contains(parts[2], "g")
var content string var content string
if filePath != "" && stdin == "" { switch {
// Read from file case filePath != "" && stdin == "":
abs, err := resolvePath(filePath) abs, err := resolvePath(filePath)
if err != nil { if err != nil {
return fmt.Sprintf("[error] sed: %v", err) return fmt.Sprintf("[error] sed: %v", err)
@@ -661,10 +672,9 @@ func FsSed(args []string, stdin string) string {
return fmt.Sprintf("[error] sed: %v", err) return fmt.Sprintf("[error] sed: %v", err)
} }
content = string(data) content = string(data)
} else if stdin != "" { case stdin != "":
// Use stdin
content = stdin content = stdin
} else { default:
return "[error] sed: no input (use file path or pipe from stdin)" return "[error] sed: no input (use file path or pipe from stdin)"
} }
// Apply sed replacement // Apply sed replacement
@@ -681,7 +691,7 @@ func FsSed(args []string, stdin string) string {
if err := os.WriteFile(abs, []byte(content), 0644); err != nil { if err := os.WriteFile(abs, []byte(content), 0644); err != nil {
return fmt.Sprintf("[error] sed: %v", err) return fmt.Sprintf("[error] sed: %v", err)
} }
return fmt.Sprintf("Modified %s", filePath) return "Modified " + filePath
} }
return content return content
} }
@@ -709,7 +719,7 @@ func FsMemory(args []string, stdin string) string {
if err != nil { if err != nil {
return fmt.Sprintf("[error] failed to store: %v", err) return fmt.Sprintf("[error] failed to store: %v", err)
} }
return fmt.Sprintf("Stored under topic: %s", topic) return "Stored under topic: " + topic
case "get": case "get":
if len(args) < 2 { if len(args) < 2 {
return "[error] usage: memory get <topic>" return "[error] usage: memory get <topic>"
@@ -738,7 +748,7 @@ func FsMemory(args []string, stdin string) string {
if err != nil { if err != nil {
return fmt.Sprintf("[error] failed to forget: %v", err) return fmt.Sprintf("[error] failed to forget: %v", err)
} }
return fmt.Sprintf("Deleted topic: %s", topic) return "Deleted topic: " + topic
default: default:
return fmt.Sprintf("[error] unknown subcommand: %s. Use: store, get, list, topics, forget, delete", args[0]) return fmt.Sprintf("[error] unknown subcommand: %s. Use: store, get, list, topics, forget, delete", args[0])
} }

View File

@@ -386,8 +386,6 @@ func pwDragBySelector(args map[string]string) []byte {
if !browserStarted || page == nil { if !browserStarted || page == nil {
return []byte(`{"error": "Browser not started. Call pw_start first."}`) return []byte(`{"error": "Browser not started. Call pw_start first."}`)
} }
// Get center coordinates of both elements using JavaScript
fromJS := fmt.Sprintf(` fromJS := fmt.Sprintf(`
function getCenter(selector) { function getCenter(selector) {
const el = document.querySelector(selector); const el = document.querySelector(selector);
@@ -406,7 +404,6 @@ func pwDragBySelector(args map[string]string) []byte {
} }
getCenter(%q) getCenter(%q)
`, toSelector) `, toSelector)
fromResult, err := page.Evaluate(fromJS) fromResult, err := page.Evaluate(fromJS)
if err != nil { if err != nil {
return []byte(fmt.Sprintf(`{"error": "failed to get from element: %s"}`, err.Error())) return []byte(fmt.Sprintf(`{"error": "failed to get from element: %s"}`, err.Error()))
@@ -417,7 +414,6 @@ func pwDragBySelector(args map[string]string) []byte {
} }
fromX := fromMap["x"].(float64) fromX := fromMap["x"].(float64)
fromY := fromMap["y"].(float64) fromY := fromMap["y"].(float64)
toResult, err := page.Evaluate(toJS) toResult, err := page.Evaluate(toJS)
if err != nil { if err != nil {
return []byte(fmt.Sprintf(`{"error": "failed to get to element: %s"}`, err.Error())) return []byte(fmt.Sprintf(`{"error": "failed to get to element: %s"}`, err.Error()))
@@ -428,8 +424,6 @@ func pwDragBySelector(args map[string]string) []byte {
} }
toX := toMap["x"].(float64) toX := toMap["x"].(float64)
toY := toMap["y"].(float64) toY := toMap["y"].(float64)
// Perform the drag using coordinates
mouse := page.Mouse() mouse := page.Mouse()
err = mouse.Move(fromX, fromY) err = mouse.Move(fromX, fromY)
if err != nil { if err != nil {

View File

@@ -135,8 +135,8 @@ func (t *Tools) initAgentsB() {
} }
func InitTools(cfg *config.Config, logger *slog.Logger, store storage.FullRepo) *Tools { func InitTools(cfg *config.Config, logger *slog.Logger, store storage.FullRepo) *Tools {
logger = logger _ = logger
cfg = cfg _ = cfg
if cfg.PlaywrightEnabled { if cfg.PlaywrightEnabled {
if err := CheckPlaywright(); err != nil { if err := CheckPlaywright(); err != nil {
// slow, need a faster check if playwright install // slow, need a faster check if playwright install
@@ -392,8 +392,7 @@ func runCmd(args map[string]string) []byte {
// memory store <topic> <data> | memory get <topic> | memory list | memory forget <topic> // memory store <topic> <data> | memory get <topic> | memory list | memory forget <topic>
return []byte(FsMemory(append([]string{"store"}, rest...), "")) return []byte(FsMemory(append([]string{"store"}, rest...), ""))
case "todo": case "todo":
// todo create|read|update|delete - route to existing todo handlers return handleTodoSubcommand(rest, args)
return []byte(handleTodoSubcommand(rest, args))
case "window", "windows": case "window", "windows":
// window list - list all windows // window list - list all windows
return listWindows(args) return listWindows(args)
@@ -545,7 +544,7 @@ Actions:
"toSelector": rest[1], "toSelector": rest[1],
}) })
default: default:
return []byte(fmt.Sprintf("unknown browser action: %s", action)) return []byte("unknown browser action: " + action)
} }
} }
@@ -816,7 +815,7 @@ func handleTodoSubcommand(args []string, originalArgs map[string]string) []byte
} }
return todoDelete(map[string]string{"id": args[1]}) return todoDelete(map[string]string{"id": args[1]})
default: default:
return []byte(fmt.Sprintf("unknown todo subcommand: %s", subcmd)) return []byte("unknown todo subcommand: " + subcmd)
} }
} }
@@ -1296,7 +1295,7 @@ func summarizeChat(args map[string]string) []byte {
if err != nil { if err != nil {
return []byte("error: failed to marshal arguments") return []byte("error: failed to marshal arguments")
} }
return []byte(data) return data
} }
// func removePlaywrightToolsFromBaseTools() { // func removePlaywrightToolsFromBaseTools() {