{"record":{"id":"927c0a4ef071088c","repo":"affaan-m/ECC","slug":"enoent","errorCode":"ENOENT","errorMessage":"Codex CLI is not installed","messagePattern":"Codex CLI is not installed","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"skills/council-multi-model/scripts/review-with-codex.js","lineNumber":119,"sourceCode":"    '--ignore-rules',\n    '--strict-config',\n    '--skip-git-repo-check',\n    '--sandbox', 'read-only',\n    '--cd', tempDir,\n    '--color', 'never',\n    '--config', 'shell_environment_policy.inherit=\"none\"',\n    '--config', 'skills.include_instructions=false',\n    '--config', 'web_search=\"disabled\"',\n    '--config', 'mcp_servers={}',\n    '--output-last-message', outputFile,\n    '-',\n  ];\n}\n\nfunction probeCodex(spawn, args, options, label) {\n  const result = spawn('codex', args, options);\n  if (result.error) {\n    if (result.error.code === 'ENOENT') throw new Error('Codex CLI is not installed');\n    throw new Error(`Codex ${label} probe failed: ${result.error.message}`);\n  }\n  if (result.status !== 0) {\n    const detail = (result.stderr || '').trim().split('\\n').slice(-1)[0];\n    throw new Error(`Codex ${label} probe failed${detail ? `: ${detail}` : ''}`);\n  }\n  return (result.stdout || '').trim();\n}\n\nfunction verifyToollessSupport(dependencies = {}) {\n  const spawn = dependencies.spawnSync || spawnSync;\n  const options = {\n    cwd: os.tmpdir(),\n    env: buildEnvironment(dependencies.env || process.env),\n    encoding: 'utf8',\n    timeout: 5_000,\n    maxBuffer: 256 * 1024,\n    windowsHide: true,","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/council-multi-model/scripts/review-with-codex.js#L101-L137","documentation":"probeCodex spawns the `codex` executable to probe version/features. When spawn fails with an ENOENT error code, it means the OS could not find the `codex` binary on PATH, so the script throws 'Codex CLI is not installed'. This is the dedicated friendly message for the missing-binary case, distinguished from other spawn errors by checking result.error.code.","triggerScenarios":"Running review-with-codex.js on a machine where the OpenAI Codex CLI was never installed, where it was installed but not added to PATH, or inside a container/CI image lacking the binary. Called by versionText and featuresText.","commonSituations":"Fresh dev machine or new container without the CLI; installed via a manager that didn't update PATH in the current shell; running under a different user (e.g. CI service user) whose PATH differs; npx-installed tool not on PATH when invoked as `codex`.","solutions":["Install the Codex CLI (npm install -g @openai/codex or per OpenAI's install docs).","Verify with `which codex` / `command -v codex`; if absent, add its install dir to PATH.","In CI, add an install step for the CLI before running this script.","Open a new shell after installation so PATH changes take effect."],"exampleFix":"// before\nnode review-with-codex.js --consent-to-openai\n// Error: Codex CLI is not installed\n\n// after\nnpm install -g @openai/codex\nnode review-with-codex.js --consent-to-openai","handlingStrategy":"try-catch","validationCode":"const which = require('child_process').spawnSync('codex', ['--version'], { stdio: 'ignore' });\nif (which.error || which.status !== 0) {\n  throw new Error('codex CLI unavailable on PATH; install @openai/codex first');\n}","typeGuard":null,"tryCatchPattern":"try {\n  runCodexReview(args);\n} catch (e) {\n  if (String(e.message) === 'Codex CLI is not installed') {\n    console.error('Install the Codex CLI: npm i -g @openai/codex');\n    process.exit(127);\n  }\n}","preventionTips":["Add a codex --version smoke check to CI before running reviews.","Document CLI installation in project onboarding docs.","After installing, verify `command -v codex` in the same shell that runs the script."],"tags":["cli","missing-binary","environment"],"backgroundTag":"command-not-found","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}