{"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":321,"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":303,"sourceCodeEnd":339,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/e2d1df569a8f04075d40e92461128ece7cf04c82/src/services/integrations/CodexCliInstaller.ts#L303-L339","documentation":"Variant of the version gate: `codex --version` exits 0 but the combined stdout/stderr contains no \\d+.\\d+.\\d+ semver, so `extractSemver` returns null. The installer warns with the raw output it saw and continues without a version verdict.","triggerScenarios":"Codex prints a banner, localized text, or empty output for `--version`, so the semver regex finds no match.","commonSituations":"Dev/custom builds printing non-standard version strings, wrappers injecting extra output, or localization changing the format.","solutions":["Run `codex --version` and inspect the exact output it prints.","Update to a standard Codex CLI release whose --version emits a plain semver.","Re-run install afterwards."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { spawnSync } from 'node:child_process';\n\nconst r = spawnSync('codex', ['--version'], { encoding: 'utf8' });\nconst output = `${r.stdout}\\n${r.stderr}`.trim();\nconst hasSemver = /\\d+\\.\\d+\\.\\d+/.test(output);\nif (r.status === 0 && !hasSemver) {\n  // unrecognized --version format: update codex before install\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check `codex --version` output format after CLI updates.","Report non-semver version output to the CLI maintainers."],"tags":["codex","version-check","parsing"],"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"}