Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(desktop): filter reserved IDs from target-only recovery targets

Yuewei-LLdfb544929038
diff --git a/apps/desktop/src/main/ownerNamespaceMigration.ts b/apps/desktop/src/main/ownerNamespaceMigration.ts
index 3daf3f5104..4a9a7c58a4 100644
--- a/apps/desktop/src/main/ownerNamespaceMigration.ts
+++ b/apps/desktop/src/main/ownerNamespaceMigration.ts
@@ -1171,8 +1171,17 @@ export async function recoverLegacyGhostPlugins(
if (isValidGhostId(id) && pendingRecoveryIds.has(id)) failedRecoveryIds.add(id);
}
const movedThisRun = new Set<string>();
+ // Pending ids that are only in the target root (already moved by a prior
+ // run) and not in any legacy source. These bypass the per-plugin
+ // rejectReservedIds guard that only runs over source legacy entries
+ // (line 1252), so reserved/official ids must be filtered here as well.
+ // Match the same conditional gating as the source-side guard: only
+ // reject when options.rejectReservedIds is true (packaged builds).
const recoveredTargetIds = (): string[] => [...pendingRecoveryIds]
- .filter((id) => movedThisRun.has(id) || (targetDiscoveryIds.has(id) && !sourceDiscoveryIds.has(id)))
+ .filter((id) =>
+ (!options.rejectReservedIds || !isOfficialGhostId(id)) &&
+ (movedThisRun.has(id) || (targetDiscoveryIds.has(id) && !sourceDiscoveryIds.has(id)))
+ )
.sort();
const targetOnlyPendingIdsWithoutFrozenDigest = (): string[] => [...pendingRecoveryIds]
.filter((id) =>