From fae3cef6aa30808ae5f590ba862d6eb394056888 Mon Sep 17 00:00:00 2001 From: mantrahq502 Date: Wed, 25 Feb 2026 11:16:34 +0800 Subject: [PATCH] fix(cron): publish agent response to outbound bus after ProcessDirectWithChannel ProcessDirectWithChannel bypasses the AgentLoop bus, so the Run() loop's PublishOutbound never fires. The response was silently discarded with _ = response, causing cron-triggered agent replies to never reach the Telegram channel. Fix by explicitly calling PublishOutbound with the response when non-empty, consistent with the deliver=true and command execution paths. --- pkg/tools/cron.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/tools/cron.go b/pkg/tools/cron.go index 562fffc84..65d93dd5c 100644 --- a/pkg/tools/cron.go +++ b/pkg/tools/cron.go @@ -327,7 +327,12 @@ func (t *CronTool) ExecuteJob(ctx context.Context, job *cron.CronJob) string { return fmt.Sprintf("Error: %v", err) } - // Response is automatically sent via MessageBus by AgentLoop - _ = response // Will be sent by AgentLoop + if response != "" { + t.msgBus.PublishOutbound(bus.OutboundMessage{ + Channel: channel, + ChatID: chatID, + Content: response, + }) + } return "ok" }