mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-04-13 21:57:29 +08:00
autonomy notify: remove notify_channel/chat_id config and always derive target from enabled channel allow_from
This commit is contained in:
@@ -938,14 +938,7 @@ func buildHeartbeatService(cfg *config.Config, msgBus *bus.MessageBus) *heartbea
|
||||
|
||||
func buildAutonomyEngine(cfg *config.Config, msgBus *bus.MessageBus) *autonomy.Engine {
|
||||
a := cfg.Agents.Defaults.Autonomy
|
||||
notifyChannel := strings.ToLower(strings.TrimSpace(a.NotifyChannel))
|
||||
notifyChatID := strings.TrimSpace(a.NotifyChatID)
|
||||
if notifyChannel == "" || notifyChatID == "" {
|
||||
if ch, chat := inferAutonomyNotifyTarget(cfg); ch != "" && chat != "" {
|
||||
notifyChannel = ch
|
||||
notifyChatID = chat
|
||||
}
|
||||
}
|
||||
notifyChannel, notifyChatID := inferAutonomyNotifyTarget(cfg)
|
||||
notifyAllowFrom := []string{}
|
||||
switch notifyChannel {
|
||||
case "telegram":
|
||||
|
||||
Reference in New Issue
Block a user