affaan-m/ECC · error · Error
Codex version could not be verified for tool-less review
Error message
Codex version could not be verified for tool-less review
What it means
Thrown by verifyToollessSupport() when `codex --version` ran successfully (probe returned 0) but its stdout did not match the regex /^codex-cli\s+([^\s]+)$/m. The script pins a specific supported Codex version and needs to parse the exact version string; an unexpected output format (a rebranded binary, a wrapper, a locale-formatted line) means the version cannot be trusted for the tool-less safety contract.
Source
Thrown at skills/council-multi-model/scripts/review-with-codex.js:142
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');
}
if (versionMatch[1] !== SUPPORTED_CODEX_VERSION) {
throw new Error(
`unsupported Codex version ${versionMatch[1]}; `
+ `tool-less review requires exactly ${SUPPORTED_CODEX_VERSION}`
);
}
const featuresText = probeCodex(spawn, ['features', 'list'], options, 'feature');
const stages = new Map();
for (const line of featuresText.split('\n')) {
const match = line.trim().match(
/^(\S+)\s+(stable|under development|experimental|deprecated|removed)\s+(true|false)$/
);
if (match) stages.set(match[1], match[2]);
}
const unavailable = REQUIRED_TOOLLESS_FEATURES.filter(
(feature) => stages.get(feature) !== 'stable'View on GitHub (pinned to 01e15490f0)
Solutions
- Run `codex --version` by hand and confirm it prints a line like `codex-cli <version>`.
- Remove or rename any wrapper/alias that shadows the real Codex binary.
- Ensure the shell RC does not print extra lines on non-interactive spawn (buildEnvironment tries to isolate this).
Example fix
// before: a wrapper shadows codex $ codex --version my-codex-wrapper v1.2.3 // after $ unalias codex; rm ~/bin/codex # remove the wrapper $ hash -r $ codex --version codex-cli 0.146.0
Defensive patterns
Strategy: validation
Validate before calling
function parseCodexVersion(stdout) {
const m = (stdout || '').match(/^codex-cli\s+([^\s]+)$/m);
if (!m) throw new Error('Codex version could not be verified for tool-less review');
return m[1];
}
// call parseCodexVersion(spawnSync('codex', ['--version'], opts).stdout) before relying on the version Type guard
function looksLikeCodexCliVersion(stdout) {
return /^codex-cli\s+[^\s]+$/m.test(stdout || '');
} Try / catch
try {
verifyToollessSupport({ spawnSync });
} catch (error) {
if (/Codex version could not be verified/.test(error.message)) {
// remove wrapper/alias shadowing codex, then retry
} else {
throw error;
}
} Prevention
- Confirm `codex --version` prints a `codex-cli <version>` line with no extra prefix.
- Remove any wrapper/alias that shadows the real Codex binary.
- Keep shell RC files quiet on non-interactive spawn so stdout is clean.
When it happens
Trigger: A binary named codex that is not the real Codex CLI (a shim, alias, or different product); a Codex build whose --version output format changed (e.g. extra prefix text, different binary name); stdout polluted by a shell RC file or wrapper script so the first match line is not the version.
Common situations: A custom `codex` wrapper on PATH; an alias that prepends text; a different product also named codex; a preview/nightly build with a different version-string format.
Related errors
- unsupported Codex version ${versionMatch[1]}; tool-less revi
- Codex ${versionMatch[1]} cannot guarantee tool-less review;
- Codex CLI is not installed
- Codex ${label} probe failed${detail ? `: ${detail}` : ''}
- Invalid --version value
AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13).
Data as JSON: /api/errors/aad6804780fff644.
Report an issue: GitHub.