{"record":{"id":"bf8a0c81ab9b376e","repo":"thedotmack/claude-mem","slug":"could-not-parse-codex-cli-version-from-output","errorCode":null,"errorMessage":"  Could not parse Codex CLI version from \"${output || '<empty>'}\". Continuing; plugin marketplace support requires ${MIN_CODEX_MARKETPLACE_VERSION} or newer.","messagePattern":"  Could not parse Codex CLI version from \"(.+?)\"\\. Continuing; plugin marketplace support requires (.+?) or newer\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/services/integrations/CodexCliInstaller.ts","lineNumber":370,"sourceCode":"function 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>';\n  const endTag = '</claude-mem-context>';\n\n  try {\n    readAndStripContextTags(startTag, endTag);\n    return true;\n  } catch (error) {","sourceCodeStart":352,"sourceCodeEnd":388,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d8bc9755e74915e5c3b999181e10a67c889bce2a/src/services/integrations/CodexCliInstaller.ts#L352-L388","documentation":"Like the non-zero-exit case, this fires when the Codex version command succeeded but its output did not contain a parseable semver (extractSemver returned nothing). claude-mem cannot verify marketplace support, so it warns (including the raw output, or '<empty>' if blank) and continues the install rather than aborting.","triggerScenarios":"assertCodexMarketplaceSupported captures stdout+stderr, result.status === 0, but extractSemver(output) finds no x.y.z pattern — e.g. output is empty, localized text, or a non-semver build string.","commonSituations":"Codex CLI forks/rebranded builds with non-standard version strings; output polluted by shell profile banners or update notices; a stubbed `codex` script printing nothing.","solutions":["Run the version command manually and inspect the output; remove anything polluting it (shell banners, update checks)","Reinstall the official Codex CLI so `codex --version` prints a standard semver","If the version genuinely supports marketplaces, ignore the warning — install continues","Compare the installed version to MIN_CODEX_MARKETPLACE_VERSION yourself to confirm compatibility"],"exampleFix":"// before: polluted version output\n$ codex --version\nChecking for updates...\n// after: clean semver output\n$ codex --version\n0.42.0","handlingStrategy":"validation","validationCode":"const out = execSync('codex --version').toString().trim();\nif (!/\\d+\\.\\d+\\.\\d+/.test(out)) console.warn('codex --version has no parseable semver:', out || '<empty>');","typeGuard":"function hasSemver(s: string): boolean {\n  return /\\d+\\.\\d+\\.\\d+/.test(s);\n}","tryCatchPattern":"const out = (r.stdout + '\\n' + r.stderr).trim();\nconst m = out.match(/\\d+\\.\\d+\\.\\d+/);\nif (!m) console.warn('Could not parse Codex version from', out || '<empty>');","preventionTips":["Ensure `codex --version` prints a plain x.y.z semver","Remove shell profile banners/update notices that pollute command output","Reinstall the official Codex CLI if using a fork with odd version strings","Compare your version against MIN_CODEX_MARKETPLACE_VERSION manually"],"tags":["codex","versioning","installer","parse"],"backgroundTag":"unexpected-response-shape","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"}