fix(cron): deliver agent response instead of raw payload message

This commit is contained in:
viettranx committed 2026-03-09 09:44:45 +07:00
1 parent 1f8bcbb559
commit 08ca343972
1 file changed
+2 -3
+2 -3
View File
@@ -62,13 +62,12 @@ func makeCronJobHandler(sched *scheduler.Scheduler, msgBus *bus.MessageBus, cfg
result := outcome.Result
// If job wants delivery to a channel, send the cron reminder message
// directly (not the agent response) so it appears as a bot notification.
// If job wants delivery to a channel, send the agent response to the target chat.
if job.Payload.Deliver && job.Payload.Channel != "" && job.Payload.To != "" {
outMsg := bus.OutboundMessage{
Channel: job.Payload.Channel,
ChatID: job.Payload.To,
Content: job.Payload.Message,
Content: result.Content,
}
if peerKind == "group" {
outMsg.Metadata = map[string]string{"group_id": job.Payload.To}