fix: remove duplicate allowlist initialization in exec tool

This commit is contained in:
野生派Coder~
2026-02-14 14:15:00 +08:00
parent 2daec65245
commit 1451dc35f7

View File

@@ -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,