Merge pull request #4 from YspCoder/codex/conduct-robustness-check-on-code

fix: remove duplicate allowlist initialization in shell exec tool
This commit is contained in:
野生派Coder~
2026-02-14 14:15:18 +08:00
committed by GitHub

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,