summaryrefslogtreecommitdiff
path: root/tools.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2026-03-01 12:28:23 +0300
committerGrail Finder <wohilas@gmail.com>2026-03-01 12:28:23 +0300
commit01d8bcdbf58aee18643645ac292e26904551776e (patch)
treecd35938d2d0c43b6c0f241cbb93cd9f8ed24e84e /tools.go
parentf6a395bce9343a9224b2c43b231a749108acad1e (diff)
Enha: avoid \n\n in tool collapse
Diffstat (limited to 'tools.go')
-rw-r--r--tools.go4
1 files changed, 0 insertions, 4 deletions
diff --git a/tools.go b/tools.go
index b1e5bbd..04ba554 100644
--- a/tools.go
+++ b/tools.go
@@ -763,7 +763,6 @@ func executeCommand(args map[string]string) []byte {
logger.Error(msg)
return []byte(msg)
}
-
// Handle commands passed as single string with spaces (e.g., "go run main.go" or "cd /tmp")
// Split into base command and arguments
parts := strings.Fields(commandStr)
@@ -774,18 +773,15 @@ func executeCommand(args map[string]string) []byte {
}
command := parts[0]
cmdArgs := parts[1:]
-
if !isCommandAllowed(command, cmdArgs...) {
msg := fmt.Sprintf("command '%s' is not allowed", command)
logger.Error(msg)
return []byte(msg)
}
-
// Special handling for cd command - update FilePickerDir
if command == "cd" {
return handleCdCommand(cmdArgs)
}
-
// Execute with timeout for safety
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()