fix(gateway): only sync configured channel plugins and cleanup unconfigured extensions (#898)

This commit is contained in:
paisley
2026-04-23 17:30:53 +08:00
committed by GitHub
parent 956e943072
commit 1b75fec71c
4 changed files with 130 additions and 87 deletions

View File

@@ -994,6 +994,22 @@ export async function deleteChannelConfig(channelType: string): Promise<void> {
if (isWechatChannelType(resolvedChannelType)) {
removePluginRegistration(currentConfig, WECHAT_PLUGIN_ID);
}
// Clean up third-party plugin registrations when their channel is removed.
if (resolvedChannelType === 'feishu') {
for (const candidateId of FEISHU_PLUGIN_ID_CANDIDATES) {
removePluginRegistration(currentConfig, candidateId);
}
// Also remove the built-in feishu disable entry since it's no longer needed
if (currentConfig.plugins?.entries?.feishu) {
delete currentConfig.plugins.entries.feishu;
}
}
if (resolvedChannelType === 'dingtalk') {
removePluginRegistration(currentConfig, 'dingtalk');
}
if (resolvedChannelType === 'wecom') {
removePluginRegistration(currentConfig, WECOM_PLUGIN_ID);
}
syncBuiltinChannelsWithPluginAllowlist(currentConfig);
await writeOpenClawConfig(currentConfig);
if (isWechatChannelType(resolvedChannelType)) {