diff --git a/src/commands/doctor-plugin-manifests.ts b/src/commands/doctor-plugin-manifests.ts index 6ba9470cd8b..0f2127fc50b 100644 --- a/src/commands/doctor-plugin-manifests.ts +++ b/src/commands/doctor-plugin-manifests.ts @@ -34,6 +34,14 @@ function readManifestJson(manifestPath: string): Record | null } } +function manifestSeenKey(manifestPath: string): string { + try { + return fs.realpathSync.native(manifestPath); + } catch { + return path.resolve(manifestPath); + } +} + function buildLegacyManifestContractMigration(params: { manifestPath: string; raw: Record; @@ -99,10 +107,11 @@ export function collectLegacyPluginManifestContractMigrations(params?: { continue; } const manifestPath = path.join(root, entry.name, "openclaw.plugin.json"); - if (seen.has(manifestPath)) { + const seenKey = manifestSeenKey(manifestPath); + if (seen.has(seenKey)) { continue; } - seen.add(manifestPath); + seen.add(seenKey); const raw = readManifestJson(manifestPath); if (!raw) { continue; @@ -120,10 +129,11 @@ export function collectLegacyPluginManifestContractMigrations(params?: { ...(params?.env ? { env: params.env } : {}), ...(params?.workspaceDir ? { workspaceDir: params.workspaceDir } : {}), }).plugins) { - if (seen.has(plugin.manifestPath)) { + const seenKey = manifestSeenKey(plugin.manifestPath); + if (seen.has(seenKey)) { continue; } - seen.add(plugin.manifestPath); + seen.add(seenKey); const raw = readManifestJson(plugin.manifestPath); if (!raw) { continue;