{"record":{"id":"d7e81da5c8707ebd","repo":"affaan-m/ECC","slug":"codex-label-probe-failed-detail-detail","errorCode":null,"errorMessage":"Codex ${label} probe failed${detail ? `: ${detail}` : ''}","messagePattern":"Codex (.+?) probe failed(.+?)` : ''\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"skills/council-multi-model/scripts/review-with-codex.js","lineNumber":124,"sourceCode":"    '--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  };\n  const versionText = probeCodex(spawn, ['--version'], options, 'version');\n  const versionMatch = versionText.match(/^codex-cli\\s+([^\\s]+)$/m);\n  if (!versionMatch) {\n    throw new Error('Codex version could not be verified for tool-less review');","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/council-multi-model/scripts/review-with-codex.js#L106-L142","documentation":"probeCodex wraps every `codex` CLI probe invocation. When the spawned process exits with a non-zero status code, this error is thrown with the last line of the CLI's stderr appended as detail (e.g. `Codex version probe failed: <stderr line>`). It signals that the Codex CLI itself rejected the probe command, so the tool-less review cannot proceed.","triggerScenarios":"Calling verifyToollessSupport() which invokes probeCodex(spawn, ['--version'], ..., 'version') or probeCodex(spawn, ['features', 'list'], ..., 'feature'); the spawned `codex --version` or `codex features list` process returns a non-zero exit status.","commonSituations":"A broken or partially uninstalled Codex CLI; a Codex binary that fails on startup due to corrupt CODEX_HOME config; a version of codex-cli that does not support the `features list` subcommand; an authenticated/session error printed to stderr by the CLI.","solutions":["Run `codex --version` (and `codex features list`) manually in a terminal to see the full stderr and fix the underlying CLI failure","Reinstall or update the Codex CLI to a known-good version (script pins codex-cli 0.146.0)","Clear or repair CODEX_HOME configuration that may be crashing the CLI at startup","Check that the sanitized environment (PATH, HOME, CODEX_HOME) passed to the probe still allows the CLI to run"],"exampleFix":"// before (old codex without subcommand)\n$ codex features list\nUnknown command: features\n// after (upgrade Codex CLI)\nnpm install -g @openai/codex@0.146.0\n$ codex features list   # exits 0","handlingStrategy":"try-catch","validationCode":"const { execFileSync } = require('child_process');\nfunction codexProbeWorks() {\n  try {\n    execFileSync('codex', ['--version'], { encoding: 'utf8', timeout: 5000 });\n    return true;\n  } catch (e) {\n    return false;\n  }\n}","typeGuard":"function isSpawnOk(result) {\n  return result != null && !result.error && result.status === 0;\n}","tryCatchPattern":"try {\n  const version = verifyToollessSupport();\n} catch (err) {\n  if (String(err.message).startsWith('Codex version probe failed')) {\n    console.error('Codex CLI probe failed; reinstall or repair codex:', err.message);\n  } else throw err;\n}","preventionTips":["Smoke-test `codex --version` in CI before running reviews","Pin and verify the Codex install in your environment bootstrap","Keep CODEX_HOME config minimal to avoid CLI startup crashes","Log full stderr, not just the last line, when debugging probe failures"],"tags":["cli","process-spawn","codex","exit-code"],"backgroundTag":"http-error-response","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"}