{"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":180,"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":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/e2d1df569a8f04075d40e92461128ece7cf04c82/src/services/integrations/CodexCliInstaller.ts#L162-L198","documentation":"`registerCodexMarketplace` runs `codex plugin marketplace add <root>`. When that fails because MARKETPLACE_NAME is already registered pointing at a different source, the installer warns, runs `codex plugin marketplace remove MARKETPLACE_NAME`, then re-adds from the new root. The warning means the old registration was detected and replaced.","triggerScenarios":"Codex already has the claude-mem marketplace registered from a different path (old install location, moved checkout, different npm cache dir) while a new install registers a new marketplaceRoot.","commonSituations":"Reinstalling after moving the repo, switching between local dev and npm installs, or npm cache paths changing between Node versions.","solutions":["No action required — the installer removes and re-adds the marketplace automatically.","Verify afterwards: `codex plugin marketplace list` should show the new root.","If the warning appears on every install, remove the marketplace manually (`codex plugin marketplace remove claude-mem`) and reinstall."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"import { spawnSync } from 'node:child_process';\n\nconst list = spawnSync('codex', ['plugin', 'marketplace', 'list'], { encoding: 'utf8' });\nconst staleRegistration = list.stdout.includes('claude-mem') && !list.stdout.includes(expectedMarketplaceRoot);\nif (staleRegistration) {\n  spawnSync('codex', ['plugin', 'marketplace', 'remove', 'claude-mem']);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer a single install source (npm or local dev) per machine.","Remove the marketplace before switching install sources."],"tags":["codex","marketplace","reinstall","conflict"],"backgroundTag":"marketplace-source-conflict","analyzedSha":"e2d1df569a8f04075d40e92461128ece7cf04c82","analyzedAt":"2026-08-20T23:58:13.836Z","contentChangedAt":"2026-08-20T23:58:13.836Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}