thedotmack/claude-mem · warning

Could not parse Codex CLI version from

Error message

  Could not parse Codex CLI version from "${output || '<empty>'}". Continuing; plugin marketplace support requires ${MIN_CODEX_MARKETPLACE_VERSION} or newer.

What it means

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.

Solutions

  1. Run the version command manually and inspect the output; remove anything polluting it (shell banners, update checks)
  2. Reinstall the official Codex CLI so `codex --version` prints a standard semver
  3. If the version genuinely supports marketplaces, ignore the warning — install continues
  4. Compare the installed version to MIN_CODEX_MARKETPLACE_VERSION yourself to confirm compatibility

Example fix

// before: polluted version output
$ codex --version
Checking for updates...
// after: clean semver output
$ codex --version
0.42.0
Defensive patterns

Strategy: validation

Validate before calling

const out = execSync('codex --version').toString().trim();
if (!/\d+\.\d+\.\d+/.test(out)) console.warn('codex --version has no parseable semver:', out || '<empty>');

Type guard

function hasSemver(s: string): boolean {
  return /\d+\.\d+\.\d+/.test(s);
}

Try / catch

const out = (r.stdout + '\n' + r.stderr).trim();
const m = out.match(/\d+\.\d+\.\d+/);
if (!m) console.warn('Could not parse Codex version from', out || '<empty>');

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of thedotmack/claude-mem@d8bc9755e7 (2026-09-17). Data as JSON: /api/errors/bf8a0c81ab9b376e. Report an issue: GitHub.

Appendix: source

Thrown at src/services/integrations/CodexCliInstaller.ts:370

function extractSemver(value: string): string | null {
  return value.match(/\d+\.\d+\.\d+/)?.[0] ?? null;
}

function assertCodexMarketplaceSupported(): void {
  const result = codexSpawn(['--version']);
  const output = `${result.stdout ?? ''}\n${result.stderr ?? ''}`.trim();

  if (result.error) {
    throw result.error;
  }
  if (result.status !== 0) {
    console.warn(`  Could not determine Codex CLI version. Continuing; plugin marketplace support requires ${MIN_CODEX_MARKETPLACE_VERSION} or newer.${output ? `\n${output}` : ''}`);
    return;
  }

  const version = extractSemver(output);
  if (!version) {
    console.warn(`  Could not parse Codex CLI version from "${output || '<empty>'}". Continuing; plugin marketplace support requires ${MIN_CODEX_MARKETPLACE_VERSION} or newer.`);
    return;
  }

  if (version.localeCompare(MIN_CODEX_MARKETPLACE_VERSION, undefined, { numeric: true }) < 0) {
    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`);
  }
}

function removeCodexAgentsMdContext(): boolean {
  if (!existsSync(CODEX_AGENTS_MD_PATH)) return true;

  const startTag = '<claude-mem-context>';
  const endTag = '</claude-mem-context>';

  try {
    readAndStripContextTags(startTag, endTag);
    return true;
  } catch (error) {

View on GitHub (pinned to d8bc9755e7)