




















@@ -200,6 +200,48 @@ function migrateTelegramRequireMention(raw: Record<string, unknown>, changes: st
200200raw.channels = channels;
201201}
202202203+function hasLegacyFeishuAccountBotName(value: unknown): boolean {
204+const accounts = getRecord(value);
205+if (!accounts) {
206+return false;
207+}
208+return Object.values(accounts).some((entry) => {
209+const account = getRecord(entry);
210+return Boolean(account && hasOwnKey(account, "botName"));
211+});
212+}
213+214+function migrateFeishuAccountBotName(raw: Record<string, unknown>, changes: string[]): void {
215+const channels = getRecord(raw.channels);
216+const feishu = getRecord(channels?.feishu);
217+const accounts = getRecord(feishu?.accounts);
218+if (!channels || !feishu || !accounts) {
219+return;
220+}
221+222+for (const [accountId, accountRaw] of Object.entries(accounts)) {
223+const account = getRecord(accountRaw);
224+if (!account || !hasOwnKey(account, "botName")) {
225+continue;
226+}
227+228+const legacyPath = `channels.feishu.accounts.${accountId}.botName`;
229+const currentPath = `channels.feishu.accounts.${accountId}.name`;
230+if (account.name === undefined) {
231+account.name = account.botName;
232+changes.push(`Moved ${legacyPath} → ${currentPath}.`);
233+} else {
234+changes.push(`Removed ${legacyPath} (${currentPath} already set).`);
235+}
236+delete account.botName;
237+accounts[accountId] = account;
238+}
239+240+feishu.accounts = accounts;
241+channels.feishu = feishu;
242+raw.channels = channels;
243+}
244+203245function hasLegacyThreadBindingTtl(value: unknown): boolean {
204246const threadBindings = getRecord(value);
205247return Boolean(threadBindings && hasOwnKey(threadBindings, "ttlHours"));
@@ -409,6 +451,15 @@ const GROUP_ROUTING_RULES: LegacyConfigRule[] = [
409451},
410452];
411453454+const FEISHU_ACCOUNT_RULES: LegacyConfigRule[] = [
455+{
456+path: ["channels", "feishu", "accounts"],
457+message:
458+'channels.feishu.accounts.<id>.botName was renamed to channels.feishu.accounts.<id>.name. Run "openclaw doctor --fix".',
459+match: (value) => hasLegacyFeishuAccountBotName(value),
460+},
461+];
462+412463export const LEGACY_CONFIG_MIGRATIONS_CHANNELS: LegacyConfigMigrationSpec[] = [
413464defineLegacyConfigMigration({
414465id: "legacy-group-routing->channel-groups",
@@ -421,6 +472,14 @@ export const LEGACY_CONFIG_MIGRATIONS_CHANNELS: LegacyConfigMigrationSpec[] = [
421472migrateTelegramRequireMention(raw, changes);
422473},
423474}),
475+defineLegacyConfigMigration({
476+id: "feishu.accounts.botName->name",
477+describe: "Move legacy Feishu account botName config to account name",
478+legacyRules: FEISHU_ACCOUNT_RULES,
479+apply: (raw, changes) => {
480+migrateFeishuAccountBotName(raw, changes);
481+},
482+}),
424483defineLegacyConfigMigration({
425484id: "thread-bindings.ttlHours->idleHours",
426485describe:
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。