fix(exec) fail close on invalid deny pattern (#781)

* fix(exec) fail close on invalid deny pattern

* fix: error check

* resolve conflicts
This commit is contained in:
Mauro
2026-02-28 09:24:26 +01:00
committed by GitHub
parent 6c8866de6f
commit 172e6ebe5f
6 changed files with 77 additions and 22 deletions
+7 -1
View File
@@ -1,6 +1,7 @@
package agent
import (
"log"
"os"
"path/filepath"
"strings"
@@ -51,7 +52,12 @@ func NewAgentInstance(
toolsRegistry.Register(tools.NewReadFileTool(workspace, restrict))
toolsRegistry.Register(tools.NewWriteFileTool(workspace, restrict))
toolsRegistry.Register(tools.NewListDirTool(workspace, restrict))
toolsRegistry.Register(tools.NewExecToolWithConfig(workspace, restrict, cfg))
execTool, err := tools.NewExecToolWithConfig(workspace, restrict, cfg)
if err != nil {
log.Fatalf("Critical error: unable to initialize exec tool: %v", err)
}
toolsRegistry.Register(execTool)
toolsRegistry.Register(tools.NewEditFileTool(workspace, restrict))
toolsRegistry.Register(tools.NewAppendFileTool(workspace, restrict))