From 189516d8173022943f25a149bfecc73bdbc3400a Mon Sep 17 00:00:00 2001 From: DBT Date: Sun, 1 Mar 2026 03:16:27 +0000 Subject: [PATCH] autonomy notify: remove notify_channel/chat_id config and always derive target from enabled channel allow_from --- cmd/clawgo/cmd_gateway.go | 9 +-------- config.example.json | 4 +--- pkg/config/config.go | 4 ---- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/cmd/clawgo/cmd_gateway.go b/cmd/clawgo/cmd_gateway.go index 0e653f4..4658e84 100644 --- a/cmd/clawgo/cmd_gateway.go +++ b/cmd/clawgo/cmd_gateway.go @@ -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": diff --git a/config.example.json b/config.example.json index e75d04d..fb8eaf5 100644 --- a/config.example.json +++ b/config.example.json @@ -27,9 +27,7 @@ "max_rounds_without_user": 12, "task_history_retention_days": 3, "waiting_resume_debounce_sec": 5, - "allowed_task_keywords": [], - "notify_channel": "", - "notify_chat_id": "" + "allowed_task_keywords": [] }, "texts": { "no_response_fallback": "I've completed processing but have no response to give.", diff --git a/pkg/config/config.go b/pkg/config/config.go index faa1246..e926152 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -59,8 +59,6 @@ type AutonomyConfig struct { TaskHistoryRetentionDays int `json:"task_history_retention_days" env:"CLAWGO_AGENTS_DEFAULTS_AUTONOMY_TASK_HISTORY_RETENTION_DAYS"` WaitingResumeDebounceSec int `json:"waiting_resume_debounce_sec" env:"CLAWGO_AGENTS_DEFAULTS_AUTONOMY_WAITING_RESUME_DEBOUNCE_SEC"` AllowedTaskKeywords []string `json:"allowed_task_keywords" env:"CLAWGO_AGENTS_DEFAULTS_AUTONOMY_ALLOWED_TASK_KEYWORDS"` - NotifyChannel string `json:"notify_channel" env:"CLAWGO_AGENTS_DEFAULTS_AUTONOMY_NOTIFY_CHANNEL"` - NotifyChatID string `json:"notify_chat_id" env:"CLAWGO_AGENTS_DEFAULTS_AUTONOMY_NOTIFY_CHAT_ID"` } type AgentTextConfig struct { @@ -330,8 +328,6 @@ func DefaultConfig() *Config { TaskHistoryRetentionDays: 3, WaitingResumeDebounceSec: 5, AllowedTaskKeywords: []string{}, - NotifyChannel: "", - NotifyChatID: "", }, Texts: AgentTextConfig{ NoResponseFallback: "I've completed processing but have no response to give.",