refactor: unify channel open-group-policy warning builders

This commit is contained in:
Peter Steinberger
2026-03-07 22:06:29 +00:00
parent 4b61779a46
commit 8e0e76697a
19 changed files with 293 additions and 22 deletions

View File

@@ -1,3 +1,4 @@
import { buildOpenGroupPolicyConfigureRouteAllowlistWarning } from "openclaw/plugin-sdk";
import {
applyAccountNameToChannelSection,
applySetupAccountConfigPatch,
@@ -212,7 +213,12 @@ export const googlechatPlugin: ChannelPlugin<ResolvedGoogleChatAccount> = {
});
if (groupPolicy === "open") {
warnings.push(
`- Google Chat spaces: groupPolicy="open" allows any space to trigger (mention-gated). Set channels.googlechat.groupPolicy="allowlist" and configure channels.googlechat.groups.`,
buildOpenGroupPolicyConfigureRouteAllowlistWarning({
surface: "Google Chat spaces",
openScope: "any space",
groupPolicyPath: "channels.googlechat.groupPolicy",
routeAllowlistPath: "channels.googlechat.groups",
}),
);
}
if (account.config.dm?.policy === "open") {