fix(gateway): gateway start waiting (#120)

This commit is contained in:
Haze
2026-02-20 21:23:06 +08:00
committed by GitHub
Unverified
parent f821949829
commit 34105d60c6
2 changed files with 114 additions and 37 deletions

View File

@@ -172,6 +172,24 @@ export function saveChannelConfig(
}
}
// Special handling for Feishu: default to open DM policy with wildcard allowlist
if (channelType === 'feishu') {
const existingConfig = currentConfig.channels[channelType] || {};
transformedConfig.dmPolicy = transformedConfig.dmPolicy ?? existingConfig.dmPolicy ?? 'open';
let allowFrom = transformedConfig.allowFrom ?? existingConfig.allowFrom ?? ['*'];
if (!Array.isArray(allowFrom)) {
allowFrom = [allowFrom];
}
// If dmPolicy is open, OpenClaw schema requires '*' in allowFrom
if (transformedConfig.dmPolicy === 'open' && !allowFrom.includes('*')) {
allowFrom = [...allowFrom, '*'];
}
transformedConfig.allowFrom = allowFrom;
}
// Merge with existing config
currentConfig.channels[channelType] = {
...currentConfig.channels[channelType],