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 retry-path discoveryDeferred and status recoveredIds

Yuewei-LL43ee218f0bfd
diff --git a/apps/desktop/src/main/ownerNamespaceMigration.ts b/apps/desktop/src/main/ownerNamespaceMigration.ts
index b76d6fb6c9..a9f882b0aa 100644
--- a/apps/desktop/src/main/ownerNamespaceMigration.ts
+++ b/apps/desktop/src/main/ownerNamespaceMigration.ts
@@ -1278,7 +1278,8 @@ export function getLegacyGhostRecoveryStatus(
const recoveredIds = (recoveryMarker?.pendingIds ?? []).filter((id) =>
installedTargetIds.has(id) &&
!legacySourceIds.has(id) &&
- recoveryMarker?.approvalProjectionSha256ById?.[id] !== undefined,
+ recoveryMarker?.approvalProjectionSha256ById?.[id] !== undefined &&
+ (!options.rejectReservedIds || !isOfficialGhostId(id)),
);
const unexpectedFrozenIds = recoveryMarker
? legacyGhosts.map((ghost) => ghost.id).filter((id) => !recoveryMarker.pendingIds.includes(id))
@@ -1407,13 +1408,16 @@ export async function recoverLegacyGhostPlugins(
const targetDiscovery = hasRecoveryCandidates
? scanLegacyGhostDirsInRoots([targetRoot])
: { ghosts: [], deferredIds: [], invalidIds: [], deferredRoots: [] };
+ // Filter reserved IDs from per-id counts so they don't force a spurious
+ // deferred that blocks valid legacy plugins from being moved (P1,
+ // PRRT_kwDOTgdRUs6YSU-u). Match the filter already applied in
+ // getLegacyGhostRecoveryStatus.
const discoveryDeferred =
sharedDiscovery.deferredRoots.length > 0 ||
- sharedDiscovery.deferredIds.length > 0 ||
scopedDiscovery.deferredRoots.length > 0 ||
- scopedDiscovery.deferredIds.length > 0 ||
targetDiscovery.deferredRoots.length > 0 ||
- targetDiscovery.deferredIds.length > 0;
+ [...sharedDiscovery.deferredIds, ...scopedDiscovery.deferredIds, ...targetDiscovery.deferredIds]
+ .some((id) => !options.rejectReservedIds || !isOfficialGhostId(id));
const discoveryInvalidCount = new Set([
...sharedDiscovery.invalidIds,
...scopedDiscovery.invalidIds,