refactor(channels): centralize runtime group policy handling

This commit is contained in:
Peter Steinberger
2026-02-22 12:35:02 +01:00
parent a4607277a9
commit 85e5ed3f78
34 changed files with 345 additions and 300 deletions

View File

@@ -3,7 +3,7 @@ import {
DEFAULT_ACCOUNT_ID,
LineConfigSchema,
processLineMessage,
resolveRuntimeGroupPolicy,
resolveAllowlistProviderRuntimeGroupPolicy,
type ChannelPlugin,
type ChannelStatusIssue,
type OpenClawConfig,
@@ -163,12 +163,10 @@ export const linePlugin: ChannelPlugin<ResolvedLineAccount> = {
},
collectWarnings: ({ account, cfg }) => {
const defaultGroupPolicy = cfg.channels?.defaults?.groupPolicy;
const { groupPolicy } = resolveRuntimeGroupPolicy({
const { groupPolicy } = resolveAllowlistProviderRuntimeGroupPolicy({
providerConfigPresent: cfg.channels?.line !== undefined,
groupPolicy: account.config.groupPolicy,
defaultGroupPolicy,
configuredFallbackPolicy: "allowlist",
missingProviderFallbackPolicy: "allowlist",
});
if (groupPolicy !== "open") {
return [];