{"record":{"id":"77ec55fa0ceaeee5","repo":"can1357/oh-my-pi","slug":"marketplace-catalog-name-changed-from-name-to","errorCode":null,"errorMessage":"Marketplace catalog name changed from \"${name}\" to \"${catalog.name}\". Remove and re-add the marketplace to update.","messagePattern":"Marketplace catalog name changed from \"(.+?)\" to \"(.+?)\"\\. Remove and re-add the marketplace to update\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/extensibility/plugins/marketplace/manager.ts","lineNumber":166,"sourceCode":"\t\tlogger.debug(\"Marketplace removed\", { name });\n\t}\n\n\tasync updateMarketplace(name: string): Promise<MarketplaceRegistryEntry> {\n\t\tconst reg = await readMarketplacesRegistry(this.#opts.marketplacesRegistryPath);\n\t\tconst existing = getMarketplaceEntry(reg, name);\n\t\tif (!existing) {\n\t\t\tthrow new Error(`Marketplace \"${name}\" not found`);\n\t\t}\n\n\t\tconst { catalog, clonePath } = await fetchMarketplace(existing.sourceUri, this.#opts.marketplacesCacheDir);\n\n\t\t// Guard against upstream catalog silently renaming itself — the registry\n\t\t// entry is keyed by name, so a drift would corrupt the entry on next read.\n\t\tif (catalog.name !== name) {\n\t\t\tif (clonePath) {\n\t\t\t\tawait fs.rm(clonePath, { recursive: true, force: true }).catch(() => {});\n\t\t\t}\n\t\t\tthrow new Error(\n\t\t\t\t`Marketplace catalog name changed from \"${name}\" to \"${catalog.name}\". ` +\n\t\t\t\t\t`Remove and re-add the marketplace to update.`,\n\t\t\t);\n\t\t}\n\n\t\t// Promote the temp clone to its final cache location now that drift check passed.\n\t\tif (clonePath) {\n\t\t\tawait promoteCloneToCache(clonePath, this.#opts.marketplacesCacheDir, catalog.name);\n\t\t}\n\n\t\t// Overwrite the cached catalog and migrate legacy home-relative registry entries.\n\t\tconst catalogPath = path.resolve(expandTilde(existing.catalogPath));\n\t\tawait Bun.write(catalogPath, `${JSON.stringify(catalog, null, 2)}\\n`);\n\n\t\tconst updatedEntry: MarketplaceRegistryEntry = {\n\t\t\t...existing,\n\t\t\tcatalogPath,\n\t\t\tupdatedAt: new Date().toISOString(),","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/extensibility/plugins/marketplace/manager.ts#L148-L184","documentation":"updateMarketplace guards against the upstream catalog renaming itself: since registry entries are keyed by catalog name, silently accepting a rename would corrupt the entry on next read. It throws after cleaning up the temp clone, telling the user to remove and re-add the marketplace.","triggerScenarios":"updateMarketplace(name) succeeds in fetching, but the fetched catalog's `name` differs from the registered `name` — upstream renamed their catalog, or the source was repointed (e.g. the same URL now serves a different marketplace).","commonSituations":"A marketplace maintainer renames their catalog between releases and you run update; a URL/tarball source is overwritten with a differently-named marketplace; a fork reusing the same source URI under a new name.","solutions":["As the message says: remove the marketplace (removeMarketplace(name)) and add it again with the new source — the registry will pick up the new name.","If the rename was unintentional upstream, contact the maintainer or pin to a revision/URL that still has the old name.","Update any scripts/automation to reference the new marketplace name after re-adding."],"exampleFix":"// before: blind update fails on rename\nawait manager.updateMarketplace(\"old-name\");\n// after: remove and re-add\nawait manager.removeMarketplace(\"old-name\");\nawait manager.addMarketplace(\"https://example.com/marketplace.json\"); // now named \"new-name\"","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await manager.updateMarketplace(name);\n} catch (err) {\n  if ((err as Error).message.includes(\"name changed from\")) {\n    await manager.removeMarketplace(name);\n    await manager.addMarketplace(sourceUri); // re-register under the new catalog name\n  } else throw err;\n}","preventionTips":["Pin marketplace sources to a stable revision/URL to avoid upstream renames.","Automate the remove-and-re-add recovery path in scripts that call updateMarketplace.","Coordinate with marketplace maintainers so catalog renames are announced."],"tags":["drift","registry","marketplace","state-conflict"],"backgroundTag":"catalog-name-drift","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}