From 2f7c4070f4ccf898b4c00f3db5ef8a849213d9f3 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 28 Apr 2026 19:26:19 +0100 Subject: [PATCH] fix: de-dupe doctor manifest repairs (#73235) (thanks @zqchris) --- src/commands/doctor-plugin-manifests.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) 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;