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.
This commit is contained in:
parent
bec8e13cf7
commit
fae3cef6aa
1 changed files with 7 additions and 2 deletions
|
|
@ -327,7 +327,12 @@ func (t *CronTool) ExecuteJob(ctx context.Context, job *cron.CronJob) string {
|
||||||
return fmt.Sprintf("Error: %v", err)
|
return fmt.Sprintf("Error: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Response is automatically sent via MessageBus by AgentLoop
|
if response != "" {
|
||||||
_ = response // Will be sent by AgentLoop
|
t.msgBus.PublishOutbound(bus.OutboundMessage{
|
||||||
|
Channel: channel,
|
||||||
|
ChatID: chatID,
|
||||||
|
Content: response,
|
||||||
|
})
|
||||||
|
}
|
||||||
return "ok"
|
return "ok"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue