affaan-m/ECC · error · Error

Codex ${label} probe failed${detail ? `: ${detail}` : ''}

Error message

Codex ${label} probe failed${detail ? `: ${detail}` : ''}

What it means

Thrown by probeCodex() in two cases: (a) spawnSync('codex', ...) returned a non-ENOENT spawn error (label is interpolated into the message along with result.error.message), or (b) codex exited with a non-zero status, in which case the last line of stderr is appended as detail. label is 'version' when probing `codex --version` and 'feature' when probing `codex features list`.

Source

Thrown at skills/council-multi-model/scripts/review-with-codex.js:124

    '--color', 'never',
    '--config', 'shell_environment_policy.inherit="none"',
    '--config', 'skills.include_instructions=false',
    '--config', 'web_search="disabled"',
    '--config', 'mcp_servers={}',
    '--output-last-message', outputFile,
    '-',
  ];
}

function probeCodex(spawn, args, options, label) {
  const result = spawn('codex', args, options);
  if (result.error) {
    if (result.error.code === 'ENOENT') throw new Error('Codex CLI is not installed');
    throw new Error(`Codex ${label} probe failed: ${result.error.message}`);
  }
  if (result.status !== 0) {
    const detail = (result.stderr || '').trim().split('\n').slice(-1)[0];
    throw new Error(`Codex ${label} probe failed${detail ? `: ${detail}` : ''}`);
  }
  return (result.stdout || '').trim();
}

function verifyToollessSupport(dependencies = {}) {
  const spawn = dependencies.spawnSync || spawnSync;
  const options = {
    cwd: os.tmpdir(),
    env: buildEnvironment(dependencies.env || process.env),
    encoding: 'utf8',
    timeout: 5_000,
    maxBuffer: 256 * 1024,
    windowsHide: true,
  };
  const versionText = probeCodex(spawn, ['--version'], options, 'version');
  const versionMatch = versionText.match(/^codex-cli\s+([^\s]+)$/m);
  if (!versionMatch) {
    throw new Error('Codex version could not be verified for tool-less review');

View on GitHub (pinned to 01e15490f0)

Solutions

  1. Run the failing probe by hand to see full output: `codex --version` and `codex features list`.
  2. Read the last stderr line cited in the error message for the root cause.
  3. Reinstall or repair the Codex CLI; fix config/auth if the probe reports a config error.
  4. If the binary is not executable, chmod +x or reinstall.

Example fix

// before: error 'Codex version probe failed: permission denied'
$ codex --version
bash: codex: Permission denied

// after
$ chmod +x $(which codex)
$ codex --version
codex-cli 0.146.0
Defensive patterns

Strategy: try-catch

Validate before calling

function probeCodexSafe(spawnSync, args) {
  const r = spawnSync('codex', args, { encoding: 'utf8', timeout: 5000 });
  if (r.error) return { ok: false, kind: r.error.code || 'spawn-error', message: r.error.message };
  if (r.status !== 0) return { ok: false, kind: 'nonzero', message: (r.stderr || '').trim().split('\n').pop() };
  return { ok: true, stdout: (r.stdout || '').trim() };
}

Type guard

function isHealthyProbe(result) {
  return Boolean(result && !result.error && result.status === 0);
}

Try / catch

try {
  verifyToollessSupport({ spawnSync });
} catch (error) {
  if (/^Codex (version|feature) probe failed/.test(error.message)) {
    // inspect the trailing detail, repair codex install/config, then retry once
  } else {
    throw error;
  }
}

Prevention

When it happens

Trigger: codex exists on PATH but crashes or exits non-zero during `codex --version` or `codex features list`; a spawn-level error other than ENOENT (e.g. EACCES if the binary is not executable, or a permissions error). The detail string is the last non-empty stderr line, so the underlying cause is surfaced.

Common situations: Codex installed but misconfigured (bad config file, missing auth); a broken codex build that crashes on --version; permissions on the binary; an OS/arch mismatch where the binary fails to launch.

Related errors


AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13). Data as JSON: /api/errors/d7e81da5c8707ebd. Report an issue: GitHub.