Skip to content

Commit 2f7c407

Browse files
committed
fix: de-dupe doctor manifest repairs (#73235) (thanks @zqchris)
1 parent c244ab5 commit 2f7c407

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

src/commands/doctor-plugin-manifests.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ function readManifestJson(manifestPath: string): Record<string, unknown> | null
3434
}
3535
}
3636

37+
function manifestSeenKey(manifestPath: string): string {
38+
try {
39+
return fs.realpathSync.native(manifestPath);
40+
} catch {
41+
return path.resolve(manifestPath);
42+
}
43+
}
44+
3745
function buildLegacyManifestContractMigration(params: {
3846
manifestPath: string;
3947
raw: Record<string, unknown>;
@@ -99,10 +107,11 @@ export function collectLegacyPluginManifestContractMigrations(params?: {
99107
continue;
100108
}
101109
const manifestPath = path.join(root, entry.name, "openclaw.plugin.json");
102-
if (seen.has(manifestPath)) {
110+
const seenKey = manifestSeenKey(manifestPath);
111+
if (seen.has(seenKey)) {
103112
continue;
104113
}
105-
seen.add(manifestPath);
114+
seen.add(seenKey);
106115
const raw = readManifestJson(manifestPath);
107116
if (!raw) {
108117
continue;
@@ -120,10 +129,11 @@ export function collectLegacyPluginManifestContractMigrations(params?: {
120129
...(params?.env ? { env: params.env } : {}),
121130
...(params?.workspaceDir ? { workspaceDir: params.workspaceDir } : {}),
122131
}).plugins) {
123-
if (seen.has(plugin.manifestPath)) {
132+
const seenKey = manifestSeenKey(plugin.manifestPath);
133+
if (seen.has(seenKey)) {
124134
continue;
125135
}
126-
seen.add(plugin.manifestPath);
136+
seen.add(seenKey);
127137
const raw = readManifestJson(plugin.manifestPath);
128138
if (!raw) {
129139
continue;

0 commit comments

Comments
 (0)