{"record":{"id":"b899ea99b168248f","repo":"thedotmack/claude-mem","slug":"could-not-determine-codex-cli-version-continuing-plugin","errorCode":null,"errorMessage":"  Could not determine Codex CLI version. Continuing; plugin marketplace support requires ${MIN_CODEX_MARKETPLACE_VERSION} or newer.${output ? `\\n${output}` : ''}","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":364,"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":346,"sourceCodeEnd":382,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d8bc9755e74915e5c3b999181e10a67c889bce2a/src/services/integrations/CodexCliInstaller.ts#L346-L382","documentation":"Before registering the Codex marketplace, claude-mem checks the installed Codex CLI version against MIN_CODEX_MARKETPLACE_VERSION. If the `codex --version` (or equivalent) command fails with a non-zero exit status, the check cannot verify compatibility, so it warns and continues the install instead of failing — trading a hard version gate for resilience against odd version-command failures.","triggerScenarios":"assertCodexMarketplaceSupported runs the version command via spawn and result.status !== 0 (result.error is thrown separately; only non-zero exit reaches this warn). stderr/stdout are appended to the warning.","commonSituations":"Codex CLI installed via a shim/wrapper that exits non-zero for --version; broken Codex install; permission or shell-profile issues in non-interactive environments.","solutions":["Run `codex --version` manually; fix whatever makes it exit non-zero (reinstall Codex CLI)","If the version is actually fine, ignore the warning — the install proceeds anyway","Update Codex CLI to >= MIN_CODEX_MARKETPLACE_VERSION to guarantee marketplace support","Check that the codex binary on PATH is the real CLI, not a wrapper script returning non-zero"],"exampleFix":"// before: version command broken, warning printed\n$ codex --version; echo $?  -> 1\n// after: reinstall Codex CLI\n$ npm install -g @openai/codex@latest && codex --version","handlingStrategy":"validation","validationCode":"import { execSync } from 'child_process';\ntry { console.log(execSync('codex --version').toString()); } catch (e) { console.error('codex --version fails; fix before install'); }","typeGuard":"function versionCommandWorks(v: { status: number | null }): boolean {\n  return v.status === 0;\n}","tryCatchPattern":"const r = spawnSync('codex', ['--version']);\nif (r.status !== 0) {\n  console.warn('Codex version check failed; marketplace support unverified:', r.stderr?.toString());\n}","preventionTips":["Verify `codex --version` exits 0 before running the installer","Reinstall the official Codex CLI if version output is broken","Avoid wrappers/shims around codex that alter exit codes","Capture and read stderr appended to the warning for the root cause"],"tags":["codex","versioning","installer","cli"],"backgroundTag":"command-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"}