{"record":{"id":"268fd7e9b8b6f8d0","repo":"thedotmack/claude-mem","slug":"codex-marketplace-root-resolved-is-missing-requ","errorCode":null,"errorMessage":"Codex marketplace root ${resolved} is missing required files: ${missing.join(', ')}","messagePattern":"Codex marketplace root (.+?) is missing required files: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/services/integrations/CodexCliInstaller.ts","lineNumber":103,"sourceCode":"  while (true) {\n    if (existsSync(path.join(current, '.agents', 'plugins', 'marketplace.json'))) {\n      return current;\n    }\n    const parent = path.dirname(current);\n    if (parent === current) return null;\n    current = parent;\n  }\n}\n\nfunction missingMarketplaceFiles(root: string): string[] {\n  return REQUIRED_MARKETPLACE_FILES.filter((entry) => !existsSync(path.join(root, entry)));\n}\n\nfunction assertCodexMarketplaceRoot(root: string): string {\n  const resolved = path.resolve(root);\n  const missing = missingMarketplaceFiles(resolved);\n  if (missing.length > 0) {\n    throw new Error(`Codex marketplace root ${resolved} is missing required files: ${missing.join(', ')}`);\n  }\n  return resolved;\n}\n\nfunction resolvePluginMarketplaceRoot(preferredRoot?: string): string {\n  if (preferredRoot) {\n    return assertCodexMarketplaceRoot(preferredRoot);\n  }\n\n  const candidates = [\n    process.env.CLAUDE_PLUGIN_ROOT,\n    process.env.PLUGIN_ROOT,\n    process.cwd(),\n    path.dirname(fileURLToPath(import.meta.url)),\n  ].filter((value): value is string => Boolean(value));\n\n  for (const candidate of candidates) {\n    const resolved = findAncestorWithCodexMarketplace(candidate);","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d8bc9755e74915e5c3b999181e10a67c889bce2a/src/services/integrations/CodexCliInstaller.ts#L85-L121","documentation":"assertCodexMarketplaceRoot() validates that a candidate Codex marketplace root directory contains all required marker files (.agents/plugins/marketplace.json and plugin/.codex-plugin/plugin.json). If missingMarketplaceFiles() returns any entries, it throws with the resolved root and the list of missing files, because installing the Codex plugin from an incomplete root would fail downstream.","triggerScenarios":"resolvePluginMarketplaceRoot(preferredRoot) is called with a preferredRoot that exists but lacks one or both required files; assertCodexMarketplaceRoot resolves it and finds missing marker files.","commonSituations":"Pointing the installer at a checkout of only part of the repo (e.g. a subdirectory or shallow copy without .agents/ or plugin/.codex-plugin/); running from a packaged npm tarball that excludes dot-directories (.npmignore/files list omits .agents/); a partially cloned repo where dotfiles were skipped.","solutions":["Run the installer from the true repo/package root: npx claude-mem@latest install from the directory containing .agents/plugins/marketplace.json.","Verify the marker files exist: ls .agents/plugins/marketplace.json plugin/.codex-plugin/plugin.json in the root you passed.","If installing from an npm package, ensure the package includes .agents/ and plugin/.codex-plugin/ (check the files field in package.json) or reinstall a complete release."],"exampleFix":"// before: invoked from a subdirectory without markers\ncd plugin/src && npx claude-mem@latest install\n// Error: Codex marketplace root ... is missing required files: .agents/plugins/marketplace.json\n\n// after: run from the repo root that has both marker files\ncd /path/to/claude-mem && npx claude-mem@latest install","handlingStrategy":"validation","validationCode":"import { existsSync } from 'fs';\nimport path from 'path';\nconst root = path.resolve(preferredRoot);\nconst required = ['.agents/plugins/marketplace.json', 'plugin/.codex-plugin/plugin.json'];\nconst missing = required.filter((f) => !existsSync(path.join(root, f)));\nif (missing.length > 0) {\n  throw new Error(`Run from the real marketplace root; missing: ${missing.join(', ')}`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run installers from the repo/package root, not subdirectories.","Verify marker files exist before invoking any Codex installer.","Ensure npm packaging (files field) includes .agents/ and plugin/.codex-plugin/."],"tags":["codex","install","marketplace","missing-files"],"backgroundTag":"file-not-found","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"}