From 1451dc35f758856dc43cd7dc3fb01b9ac37e432d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=87=8E=E7=94=9F=E6=B4=BECoder=EF=BD=9E?= Date: Sat, 14 Feb 2026 14:15:00 +0800 Subject: [PATCH] fix: remove duplicate allowlist initialization in exec tool --- pkg/tools/shell.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pkg/tools/shell.go b/pkg/tools/shell.go index 4867d0f..c14632c 100644 --- a/pkg/tools/shell.go +++ b/pkg/tools/shell.go @@ -39,11 +39,6 @@ func NewExecTool(cfg config.ShellConfig, workspace string) *ExecTool { allowPatterns = append(allowPatterns, regexp.MustCompile(`(?i)\b`+regexp.QuoteMeta(p)+`\b`)) } - allowPatterns := make([]*regexp.Regexp, 0, len(cfg.AllowedCmds)) - for _, p := range cfg.AllowedCmds { - allowPatterns = append(allowPatterns, regexp.MustCompile(`\b`+regexp.QuoteMeta(p)+`\b`)) - } - return &ExecTool{ workingDir: workspace, timeout: cfg.Timeout,