thedotmack/claude-mem · warning
Could not determine Codex CLI version. Continuing; plugin…
Error message
Could not determine Codex CLI version. Continuing; plugin marketplace support requires ${MIN_CODEX_MARKETPLACE_VERSION} or newer.${output ? `\n${output}` : ''} What it means
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.
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
Example fix
// before: version command broken, warning printed $ codex --version; echo $? -> 1 // after: reinstall Codex CLI $ npm install -g @openai/codex@latest && codex --version
Defensive patterns
Strategy: validation
Validate before calling
import { execSync } from 'child_process';
try { console.log(execSync('codex --version').toString()); } catch (e) { console.error('codex --version fails; fix before install'); } Type guard
function versionCommandWorks(v: { status: number | null }): boolean {
return v.status === 0;
} Try / catch
const r = spawnSync('codex', ['--version']);
if (r.status !== 0) {
console.warn('Codex version check failed; marketplace support unverified:', r.stderr?.toString());
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Could not parse Codex CLI version from
- codex failed with exit code ` : ''}
- Codex CLI is too old for plugin marketplace support. Update…
- Codex marketplace is already registered from another…
- Could not determine Codex CLI version. Continuing; plugin…
AI-assisted analysis of thedotmack/claude-mem@d8bc9755e7 (2026-09-17).
Data as JSON: /api/errors/b899ea99b168248f.
Report an issue: GitHub.
Appendix: source
Thrown at src/services/integrations/CodexCliInstaller.ts:364
function disableCodexPluginConfig(): void {
const changed = writeCodexPluginConfig(false);
console.log(` Disabled Codex plugin: ${CODEX_PLUGIN_ID}${changed ? '' : ' (already disabled)'}`);
}
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>';View on GitHub (pinned to d8bc9755e7)