config: change default dm_scope to per-channel-peer

Change the default value of session.dm_scope from "main" to
"per-channel-peer" to provide better conversation isolation by
default. This prevents context leakage between different users
and channels.
This commit is contained in:
Hoshina 2026-02-26 16:51:11 +08:00
parent 438f764c7a
commit 21654f1335
2 changed files with 10 additions and 1 deletions

View file

@ -413,3 +413,12 @@ func TestLoadConfig_WebToolsProxy(t *testing.T) {
t.Fatalf("Tools.Web.Proxy = %q, want %q", cfg.Tools.Web.Proxy, "http://127.0.0.1:7890") t.Fatalf("Tools.Web.Proxy = %q, want %q", cfg.Tools.Web.Proxy, "http://127.0.0.1:7890")
} }
} }
// TestDefaultConfig_DMScope verifies the default dm_scope value
func TestDefaultConfig_DMScope(t *testing.T) {
cfg := DefaultConfig()
if cfg.Session.DMScope != "per-channel-peer" {
t.Errorf("Session.DMScope = %q, want 'per-channel-peer'", cfg.Session.DMScope)
}
}

View file

@ -21,7 +21,7 @@ func DefaultConfig() *Config {
}, },
Bindings: []AgentBinding{}, Bindings: []AgentBinding{},
Session: SessionConfig{ Session: SessionConfig{
DMScope: "main", DMScope: "per-channel-peer",
}, },
Channels: ChannelsConfig{ Channels: ChannelsConfig{
WhatsApp: WhatsAppConfig{ WhatsApp: WhatsAppConfig{