{"record":{"id":"08ec7fc5db89a8ac","repo":"thedotmack/claude-mem","slug":"codex-marketplace-marketplace-name-is-already","errorCode":null,"errorMessage":"  Codex marketplace ${MARKETPLACE_NAME} is already registered from another source; replacing it with ${marketplaceRoot}.","messagePattern":"  Codex marketplace (.+?) is already registered from another source; replacing it with (.+?)\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/services/integrations/CodexCliInstaller.ts","lineNumber":229,"sourceCode":"}\n\nfunction isMarketplaceDifferentSourceError(error: unknown): boolean {\n  const message = error instanceof Error ? error.message : String(error);\n  return message.includes(`marketplace '${MARKETPLACE_NAME}' is already added from a different source`)\n    || message.includes(`marketplace \\`${MARKETPLACE_NAME}\\` is already added from a different source`);\n}\n\nfunction registerCodexMarketplace(marketplaceRoot: string): void {\n  try {\n    runCodex(['plugin', 'marketplace', 'add', marketplaceRoot]);\n    return;\n  } catch (error) {\n    if (!isMarketplaceDifferentSourceError(error)) {\n      throw error instanceof Error ? error : new Error(String(error));\n    }\n  }\n\n  console.warn(`  Codex marketplace ${MARKETPLACE_NAME} is already registered from another source; replacing it with ${marketplaceRoot}.`);\n  runCodex(['plugin', 'marketplace', 'remove', MARKETPLACE_NAME]);\n  runCodex(['plugin', 'marketplace', 'add', marketplaceRoot]);\n}\n\nexport function setTomlBooleanInTable(content: string, header: string, key: string, enabled: boolean): string {\n  const booleanLine = `${key} = ${enabled ? 'true' : 'false'}`;\n  const lines = content.split('\\n');\n  const headerIndex = lines.findIndex((line) => line.trim() === header);\n\n  if (headerIndex === -1) {\n    const trimmed = content.trimEnd();\n    return `${trimmed}${trimmed ? '\\n\\n' : ''}${header}\\n${booleanLine}\\n`;\n  }\n\n  let sectionEnd = headerIndex + 1;\n  while (sectionEnd < lines.length && !/^\\s*\\[/.test(lines[sectionEnd])) {\n    sectionEnd += 1;\n  }","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d8bc9755e74915e5c3b999181e10a67c889bce2a/src/services/integrations/CodexCliInstaller.ts#L211-L247","documentation":"When installing Codex integration, claude-mem registers its plugin marketplace by name (MARKETPLACE_NAME). If the Codex CLI reports the marketplace is already registered but pointing at a different source path, the installer removes the existing registration and re-adds it pointing at the current marketplaceRoot. This warning tells the user an existing registration is being replaced — intentional, but destructive to the prior source.","triggerScenarios":"registerCodexMarketplace calls `codex plugin marketplace add`, gets a 'already registered from different source' error (isMarketplaceDifferentSourceError), and falls into the warn/remove/add replacement path during performCodexInstall.","commonSituations":"User previously installed claude-mem's Codex plugin from a git repo and now installs from a local npx checkout (or vice versa); marketplace moved between machines/paths; testing dev builds alongside a production install.","solutions":["No action needed if replacing the old source is intended — this is the desired migration behavior","If the old source should be kept, cancel the install and decide which marketplace source you want, removing the other manually: codex plugin marketplace remove <name>","Pin installs to one consistent source (always npx claude-mem@latest, or always a local checkout) to avoid repeated replacements"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { execSync } from 'child_process';\nconst out = execSync('codex plugin marketplace list').toString();\nconst existing = out.match(/claude-mem.*?(\\S+)$/m); // inspect current source before install","typeGuard":null,"tryCatchPattern":"try {\n  runCodex(['plugin', 'marketplace', 'add', marketplaceRoot]);\n} catch (e) {\n  if (isMarketplaceDifferentSourceError(e)) {\n    console.warn('Replacing existing marketplace registration from another source');\n    runCodex(['plugin', 'marketplace', 'remove', MARKETPLACE_NAME]);\n    runCodex(['plugin', 'marketplace', 'add', marketplaceRoot]);\n  } else throw e;\n}","preventionTips":["Install from one consistent source (either always npx or always local checkout)","Check `codex plugin marketplace list` before reinstalling","Remove old marketplace registrations deliberately rather than stacking sources","Document which source path is canonical for your team"],"tags":["codex","marketplace","installer","config-conflict"],"backgroundTag":"file-already-exists","analyzedSha":"d8bc9755e74915e5c3b999181e10a67c889bce2a","analyzedAt":"2026-09-17T16:40:26.182Z","contentChangedAt":"2026-09-17T16:40:26.182Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}