thedotmack/claude-mem · warning

Could not parse Codex CLI version from "${output || '<empt

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

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.

Source

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

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 e2d1df569a)

Solutions

  1. Run `codex --version` and inspect the exact output it prints.
  2. Update to a standard Codex CLI release whose --version emits a plain semver.
  3. Re-run install afterwards.
Defensive patterns

Strategy: validation

Validate before calling

import { spawnSync } from 'node:child_process';

const r = spawnSync('codex', ['--version'], { encoding: 'utf8' });
const output = `${r.stdout}\n${r.stderr}`.trim();
const hasSemver = /\d+\.\d+\.\d+/.test(output);
if (r.status === 0 && !hasSemver) {
  // unrecognized --version format: update codex before install
}

Prevention

When it happens

Trigger: Codex prints a banner, localized text, or empty output for `--version`, so the semver regex finds no match.

Common situations: Dev/custom builds printing non-standard version strings, wrappers injecting extra output, or localization changing the format.

Related errors


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