From 4ec24a0f6331c7823da2d6d1e1e812d38ea72c30 Mon Sep 17 00:00:00 2001 From: Zhang Rui Date: Tue, 14 Apr 2026 21:39:13 +0800 Subject: [PATCH] fix: enhance cron job execution conditions with remote allowance --- pkg/tools/cron.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/tools/cron.go b/pkg/tools/cron.go index 8c15772eb..aa1920005 100644 --- a/pkg/tools/cron.go +++ b/pkg/tools/cron.go @@ -40,7 +40,7 @@ func NewCronTool( execEnabled := true if config != nil { allowCommand = config.Tools.Cron.AllowCommand - execEnabled = config.Tools.Exec.Enabled + execEnabled = config.Tools.Exec.Enabled && config.Tools.Exec.AllowRemote } var execTool *ExecTool @@ -189,9 +189,7 @@ func (t *CronTool) addJob(ctx context.Context, args map[string]any) *ToolResult return ErrorResult("one of at_seconds, every_seconds, or cron_expr is required") } - // GHSA-pv8c-p6jf-3fpp: command scheduling requires internal channel. When - // allow_command is disabled, explicit confirmation is required as an override. - // Non-command reminders remain open to all channels. + // If command is set, check if execution is allowed and if confirmation is provided when required command, _ := args["command"].(string) commandConfirm, _ := args["command_confirm"].(bool) if command != "" {