affaan-m/ECC · error · Error
Codex review failed${detail ? `: ${detail}` : ''}
Error message
Codex review failed${detail ? `: ${detail}` : ''} What it means
When the codex subprocess spawns successfully but exits with a non-zero status, runReview treats it as a review failure. It takes the last non-empty line of stderr and appends it as detail (': <last stderr line>') to aid diagnosis. This covers policy refusals, sandbox violations, auth errors, and config problems that don't crash the spawn itself.
Source
Thrown at skills/council-multi-model/scripts/review-with-codex.js:219
try {
const result = spawn('codex', buildCodexArgs(tempDir, outputFile), {
cwd: tempDir,
env: environment,
input: prompt,
encoding: 'utf8',
timeout: options.timeoutMs,
maxBuffer: 1024 * 1024,
windowsHide: true,
});
if (result.error) {
if (result.error.code === 'ETIMEDOUT') throw new Error('Codex review timed out');
if (result.error.code === 'ENOENT') throw new Error('Codex CLI is not installed');
throw new Error(`Codex invocation failed: ${result.error.message}`);
}
if (result.status !== 0) {
const detail = (result.stderr || '').trim().split('\n').slice(-1)[0];
throw new Error(`Codex review failed${detail ? `: ${detail}` : ''}`);
}
let text;
try {
text = readFile(outputFile, 'utf8').trim();
} catch (error) {
throw new Error(`Codex returned no final response: ${error.message}`);
}
if (!text) throw new Error('Codex returned an empty final response');
return `${providerLabel(options.hostProvider)}\n${text}`;
} finally {
remove(tempDir, { recursive: true, force: true });
}
}
function runStdinReview(options, dependencies = {}) {
const stdin = dependencies.stdin || process.stdin;
const stdout = dependencies.stdout || process.stdout;View on GitHub (pinned to 01e15490f0)
Solutions
- Read the appended stderr detail in the error message for the specific failure.
- Reproduce manually: run `codex` with the same args (see buildCodexArgs) and the same packet to see full stderr.
- Verify Codex auth/CODEX_HOME is set up and that the installed version is exactly 0.146.0.
- If a sandbox/policy rule is the cause, confirm the review packet does not require disallowed access.
Defensive patterns
Strategy: try-catch
Try / catch
try {
return runReview(packet, options);
} catch (error) {
if (error.message.startsWith('Codex review failed')) {
// error.message already carries the last stderr line; surface it to the caller
log.error('codex non-zero exit', { detail: error.message });
}
throw error;
} Prevention
- Pin Codex to exactly 0.146.0 (SUPPORTED_CODEX_VERSION) so flag/policy behavior matches buildCodexArgs.
- Set up CODEX_HOME and auth before invoking, and confirm in a pre-flight probe.
- Reproduce failures by running codex manually with the args from buildCodexArgs to read full stderr.
When it happens
Trigger: result.error is null/undefined but result.status !== 0 after the codex exec run. E.g. codex rejects the prompt under --sandbox read-only, --strict-config, or --ignore-rules; auth/credentials invalid; ephemeral constraints violated.
Common situations: CODEX_HOME/auth not configured; codex policy rejecting the content; a codex version whose flags differ from the supported 0.146.0; sandbox blocking a needed read; rate limit or quota returning non-zero.
Related errors
- Codex CLI is not installed
- Codex ${label} probe failed${detail ? `: ${detail}` : ''}
- Codex version could not be verified for tool-less review
- unsupported Codex version ${versionMatch[1]}; tool-less revi
- Codex ${versionMatch[1]} cannot guarantee tool-less review;
AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13).
Data as JSON: /api/errors/eab73efbbc96188f.
Report an issue: GitHub.