{"record":{"id":"fd7a9bc943d6a7ee","repo":"can1357/oh-my-pi","slug":"marketplace-name-not-found-fd7a9b","errorCode":null,"errorMessage":"Marketplace \"${name}\" not found","messagePattern":"Marketplace \"(.+?)\" not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/extensibility/plugins/marketplace/registry.ts","lineNumber":144,"sourceCode":"export async function writeInstalledPluginsRegistry(filePath: string, reg: InstalledPluginsRegistry): Promise<void> {\n\tawait atomicWriteJson(filePath, reg);\n}\n\n// ── Marketplace CRUD ─────────────────────────────────────────────────\n// Pure functions that transform registry state. Caller is responsible for\n// reading, mutating, and writing back.\n\nexport function addMarketplaceEntry(reg: MarketplacesRegistry, entry: MarketplaceRegistryEntry): MarketplacesRegistry {\n\tif (reg.marketplaces.some(m => m.name === entry.name)) {\n\t\tthrow new Error(`Marketplace \"${entry.name}\" already exists`);\n\t}\n\treturn { ...reg, marketplaces: [...reg.marketplaces, entry] };\n}\n\nexport function removeMarketplaceEntry(reg: MarketplacesRegistry, name: string): MarketplacesRegistry {\n\tconst filtered = reg.marketplaces.filter(m => m.name !== name);\n\tif (filtered.length === reg.marketplaces.length) {\n\t\tthrow new Error(`Marketplace \"${name}\" not found`);\n\t}\n\treturn { ...reg, marketplaces: filtered };\n}\n\nexport function getMarketplaceEntry(reg: MarketplacesRegistry, name: string): MarketplaceRegistryEntry | undefined {\n\treturn reg.marketplaces.find(m => m.name === name);\n}\n\n// ── Installed plugin CRUD ────────────────────────────────────────────\n\nexport function addInstalledPlugin(\n\treg: InstalledPluginsRegistry,\n\tid: string,\n\tentry: InstalledPluginEntry,\n): InstalledPluginsRegistry {\n\tconst existing = reg.plugins[id] ?? [];\n\treturn {\n\t\t...reg,","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/extensibility/plugins/marketplace/registry.ts#L126-L162","documentation":"removeMarketplaceEntry() filters the registry's marketplaces by name; if nothing was removed (length unchanged), the name did not exist and it throws. This prevents silent no-op removals that would leave the caller believing a marketplace was unregistered.","triggerScenarios":"Calling removeMarketplaceEntry(reg, name) where no marketplace with that exact name is registered — typo in the name, marketplace already removed, or registry loaded from a fresh/empty state.","commonSituations":"Running uninstall/cleanup scripts twice; case-sensitive name mismatch (\"Community\" vs \"community\"); attempting removal in a different scope/project where the marketplace was never registered.","solutions":["Verify the exact name via getMarketplaceEntry() or by listing the registry before removing","Make removal idempotent: check existence first and skip when absent","Fix the name spelling/case to match the registry entry"],"exampleFix":"// before\nreg = removeMarketplaceEntry(reg, \"comunity\"); // throws\n// after\nif (getMarketplaceEntry(reg, \"community\")) {\n  reg = removeMarketplaceEntry(reg, \"community\");\n}","handlingStrategy":"validation","validationCode":"import { getMarketplaceEntry, removeMarketplaceEntry } from './registry';\nif (getMarketplaceEntry(reg, name)) {\n  reg = removeMarketplaceEntry(reg, name);\n} // silently skip otherwise — idempotent remove","typeGuard":"null","tryCatchPattern":"try {\n  reg = removeMarketplaceEntry(reg, name);\n} catch (err) {\n  if (err.message === `Marketplace \"${name}\" not found`) {\n    // already gone — treat as success in cleanup scripts\n  } else throw err;\n}","preventionTips":["Copy marketplace names from the registry listing, don't retype them","Remember names are case-sensitive and exact","Write cleanup scripts that tolerate already-removed entries","Check which scope/project registry you loaded before removing"],"tags":["plugin","not-found","registry"],"backgroundTag":"marketplace-not-found","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}