{"record":{"id":"80721770e6a8b7f8","repo":"thedotmack/claude-mem","slug":"could-not-determine-codex-cli-version-continuin","errorCode":null,"errorMessage":"  Could not determine Codex CLI version. Continuing; plugin marketplace support requires ${MIN_CODEX_MARKETPLACE_VERSION} or newer.","messagePattern":"  Could not determine Codex CLI version\\. Continuing; plugin marketplace support requires (.+?) or newer\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/services/integrations/CodexCliInstaller.ts","lineNumber":315,"sourceCode":"\nfunction disableCodexPluginConfig(): void {\n  const changed = writeCodexPluginConfig(false);\n  console.log(`  Disabled Codex plugin: ${CODEX_PLUGIN_ID}${changed ? '' : ' (already disabled)'}`);\n}\n\nfunction extractSemver(value: string): string | null {\n  return value.match(/\\d+\\.\\d+\\.\\d+/)?.[0] ?? null;\n}\n\nfunction assertCodexMarketplaceSupported(): void {\n  const result = codexSpawn(['--version']);\n  const output = `${result.stdout ?? ''}\\n${result.stderr ?? ''}`.trim();\n\n  if (result.error) {\n    throw result.error;\n  }\n  if (result.status !== 0) {\n    console.warn(`  Could not determine Codex CLI version. Continuing; plugin marketplace support requires ${MIN_CODEX_MARKETPLACE_VERSION} or newer.${output ? `\\n${output}` : ''}`);\n    return;\n  }\n\n  const version = extractSemver(output);\n  if (!version) {\n    console.warn(`  Could not parse Codex CLI version from \"${output || '<empty>'}\". Continuing; plugin marketplace support requires ${MIN_CODEX_MARKETPLACE_VERSION} or newer.`);\n    return;\n  }\n\n  if (version.localeCompare(MIN_CODEX_MARKETPLACE_VERSION, undefined, { numeric: true }) < 0) {\n    throw new Error(`Codex CLI ${version} is too old for plugin marketplace support. Update Codex CLI to ${MIN_CODEX_MARKETPLACE_VERSION} or newer, then run: npx claude-mem@latest install`);\n  }\n}\n\nfunction removeCodexAgentsMdContext(): boolean {\n  if (!existsSync(CODEX_AGENTS_MD_PATH)) return true;\n\n  const startTag = '<claude-mem-context>';","sourceCodeStart":297,"sourceCodeEnd":333,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/e2d1df569a8f04075d40e92461128ece7cf04c82/src/services/integrations/CodexCliInstaller.ts#L297-L333","documentation":"Before touching the Codex marketplace, `assertCodexMarketplaceSupported` runs `codex --version` via spawnSync. A spawn error is rethrown, but a non-zero exit only warns and continues — the installer cannot confirm the CLI meets MIN_CODEX_MARKETPLACE_VERSION, so later marketplace commands may still fail on a genuinely old CLI.","triggerScenarios":"`codex --version` exits non-zero (broken shim, partially installed CLI, runtime error in the binary) while the binary itself spawns without an error object.","commonSituations":"Corrupted Codex CLI install, PATH pointing at a wrapper script that errors, or a CLI build whose --version subcommand fails.","solutions":["Run `codex --version` yourself and fix the CLI until it exits 0.","Update Codex CLI to at least the minimum marketplace version named in the message.","Re-run `npx claude-mem@latest install` once `--version` works."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { spawnSync } from 'node:child_process';\n\nconst r = spawnSync('codex', ['--version'], { encoding: 'utf8' });\nconst version = r.status === 0 ? `${r.stdout}\\n${r.stderr}`.match(/\\d+\\.\\d+\\.\\d+/)?.[0] : null;\nif (!version) {\n  // fix or update the codex CLI before running the installer\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Smoke-test `codex --version` before installing Codex integrations.","Keep Codex CLI at or above the minimum marketplace-capable version."],"tags":["codex","version-check","cli","spawn"],"backgroundTag":"cli-version-check-failed","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"}