{"record":{"id":"8324607a901044c3","repo":"affaan-m/ECC","slug":"codex-label-probe-failed-result-error-messag","errorCode":null,"errorMessage":"Codex ${label} probe failed: ${result.error.message}","messagePattern":"Codex (.+?) probe failed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"skills/council-multi-model/scripts/review-with-codex.js","lineNumber":120,"sourceCode":"    '--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,\n  };","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/council-multi-model/scripts/review-with-codex.js#L102-L138","documentation":"probeCodex catches any spawn error that is not ENOENT and rethrows it wrapped as `Codex <label> probe failed: <message>`. The label ('version' or 'features') identifies which probe failed. This covers all non-missing-binary spawn failures such as permission problems (EACCES), or the process failing to launch for OS reasons.","triggerScenarios":"Spawning `codex` when result.error is set with a code other than ENOENT: the binary exists but is not executable (EACCES), the executable format is wrong, spawn hits an OS-level limit, or a platform-specific spawn failure occurs.","commonSituations":"codex installed but lacking +x permission (e.g. copied manually or restored from backup with lost permissions); a broken/partial install; a `codex` shim on PATH pointing to a corrupt binary; running on a filesystem mounted noexec.","solutions":["Read the wrapped message after the colon — it names the underlying OS error (e.g. EACCES) and fix that cause.","If it's a permission problem, run `chmod +x $(which codex)` or reinstall the CLI.","Reinstall the Codex CLI cleanly to repair a broken install.","Check that no noexec mount or security policy is blocking execution of the binary.","If ENOENT-like behavior occurs, confirm with `which codex` that the right binary is being resolved."],"exampleFix":"// before\n$ review-with-codex.js --consent-to-openai\n// Error: Codex version probe failed: spawn EACCES\n\n// after\nchmod +x $(which codex)\n$ review-with-codex.js --consent-to-openai   // proceeds","handlingStrategy":"try-catch","validationCode":"const probe = require('child_process').spawnSync('codex', ['--version']);\nif (probe.error && probe.error.code !== 'ENOENT') {\n  throw new Error(`codex binary unusable: ${probe.error.message} (check permissions/reinstall)`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  runCodexReview(args);\n} catch (e) {\n  const m = /^Codex (\\w+) probe failed: (.+)$/.exec(String(e.message));\n  if (m) {\n    console.error(`codex ${m[1]} probe failed at OS level: ${m[2]}`);\n  }\n}","preventionTips":["Keep the Codex CLI installed via a package manager so permissions and binary format stay correct.","Avoid manually copying binaries onto PATH; reinstalls preserve exec bits.","Check mount flags (noexec) on filesystems where the CLI is installed."],"tags":["cli","spawn","process"],"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"}