autonomy notify routing: use enabled channel allow_from instead of notify_allow_chats

This commit is contained in:
DBT
2026-02-28 13:16:08 +00:00
parent c7a6d34188
commit abe002ae51
5 changed files with 23 additions and 11 deletions

View File

@@ -2,11 +2,11 @@ package autonomy
import "testing"
func TestShouldNotify_RespectsNotifyAllowChats(t *testing.T) {
func TestShouldNotify_RespectsNotifyAllowFrom(t *testing.T) {
e := &Engine{opts: Options{
DefaultNotifyChannel: "telegram",
DefaultNotifyChatID: "chat-1",
NotifyAllowChats: []string{"chat-2", "chat-3"},
NotifyAllowFrom: []string{"chat-2", "chat-3"},
NotifyCooldownSec: 1,
NotifySameReasonCooldownSec: 1,
}}
@@ -14,7 +14,7 @@ func TestShouldNotify_RespectsNotifyAllowChats(t *testing.T) {
t.Fatalf("expected notify to be blocked when chat not in allowlist")
}
e.opts.NotifyAllowChats = []string{"chat-1"}
e.opts.NotifyAllowFrom = []string{"chat-1"}
if !e.shouldNotify("k2", "") {
t.Fatalf("expected notify to pass when chat in allowlist")
}