From aba983b2000125b365dc1d0e7f52730124ff473c Mon Sep 17 00:00:00 2001 From: CandyWater Date: Sun, 22 Feb 2026 04:05:26 +0800 Subject: [PATCH] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- pkg/tools/shell.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/tools/shell.go b/pkg/tools/shell.go index 17ce529b6..8e8d75dd8 100644 --- a/pkg/tools/shell.go +++ b/pkg/tools/shell.go @@ -102,7 +102,10 @@ func NewExecToolWithConfig(workingDir string, restrict bool, config *config.Conf denyPatterns = append(denyPatterns, defaultDenyPatterns...) } - var allowPatterns []string = config.Agents.Defaults.AllowPatterns + var allowPatterns []string + if config != nil { + allowPatterns = config.Agents.Defaults.AllowPatterns + } var allowRegex []*regexp.Regexp if len(allowPatterns) > 0 { allowRegex = make([]*regexp.Regexp, 0, len(allowPatterns))