fix(channels): ensure all default account keys are correctly mirrored to top-level config

This commit is contained in:
paisley
2026-03-12 11:13:26 +08:00
Unverified
parent 706789cf4d
commit 5c07ad77fc
2 changed files with 33 additions and 15 deletions

View File

@@ -371,6 +371,17 @@ export async function saveChannelConfig(
enabled: transformedConfig.enabled ?? true,
};
// Most OpenClaw channel plugins read the default account's credentials
// from the top level of `channels.<type>` (e.g. channels.feishu.appId),
// not from `accounts.default`. Mirror them there so plugins can discover
// the credentials correctly. We use the final account entry (not
// transformedConfig) because `enabled` is only added at the account level.
if (resolvedAccountId === DEFAULT_ACCOUNT_ID) {
for (const [key, value] of Object.entries(accounts[resolvedAccountId])) {
channelSection[key] = value;
}
}
await writeOpenClawConfig(currentConfig);
logger.info('Channel config saved', {
channelType,