{"record":{"id":"aad6804780fff644","repo":"affaan-m/ECC","slug":"codex-version-could-not-be-verified-for-tool-less","errorCode":null,"errorMessage":"Codex version could not be verified for tool-less review","messagePattern":"Codex version could not be verified for tool-less review","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"skills/council-multi-model/scripts/review-with-codex.js","lineNumber":142,"sourceCode":"    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');\n  }\n  if (versionMatch[1] !== SUPPORTED_CODEX_VERSION) {\n    throw new Error(\n      `unsupported Codex version ${versionMatch[1]}; `\n      + `tool-less review requires exactly ${SUPPORTED_CODEX_VERSION}`\n    );\n  }\n\n  const featuresText = probeCodex(spawn, ['features', 'list'], options, 'feature');\n  const stages = new Map();\n  for (const line of featuresText.split('\\n')) {\n    const match = line.trim().match(\n      /^(\\S+)\\s+(stable|under development|experimental|deprecated|removed)\\s+(true|false)$/\n    );\n    if (match) stages.set(match[1], match[2]);\n  }\n  const unavailable = REQUIRED_TOOLLESS_FEATURES.filter(\n    (feature) => stages.get(feature) !== 'stable'","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/council-multi-model/scripts/review-with-codex.js#L124-L160","documentation":"verifyToollessSupport() parses the output of `codex --version` with the regex /^codex-cli\\s+([^\\s]+)$/m. If no line in the CLI output matches that shape, the script cannot determine the installed Codex version and throws this error rather than risk running a tool-less review against an unknown CLI. The expected output format is a line like `codex-cli 0.146.0`.","triggerScenarios":"verifyToollessSupport() runs successfully but the trimmed stdout of `codex --version` does not contain a line matching `codex-cli <version>` — e.g. output was empty, a shell wrapper echoed extra text, or a newer/older Codex release changed the version banner format.","commonSituations":"A Codex CLI installed via a wrapper (e.g. snap, npx shim, Homebrew) that prints a preamble; Codex versions that renamed the banner (no `codex-cli` prefix); stderr vs stdout mixing issues; extremely old or nightly builds.","solutions":["Run `codex --version` and confirm the output contains a line starting with `codex-cli ` followed by a version","Install the exact supported version (`npm install -g @openai/codex@0.146.0`) whose banner matches the expected format","Remove CLI wrappers/shims that alter the version output; call the real binary directly","If a legitimate newer Codex changed the banner, update the script's version regex"],"exampleFix":"// before\n$ codex --version\nOpenAI Codex 0.150.0      // banner format changed\n// after\nnpm install -g @openai/codex@0.146.0\n$ codex --version\ncodex-cli 0.146.0         // matches /^codex-cli\\s+([^\\s]+)$/m","handlingStrategy":"validation","validationCode":"const { execSync } = require('child_process');\nfunction codexVersionParses() {\n  const out = execSync('codex --version', { encoding: 'utf8' });\n  return /^codex-cli\\s+([^\\s]+)$/m.test(out.trim());\n}","typeGuard":"function hasKnownVersion(versionText) {\n  return typeof versionText === 'string' && /^codex-cli\\s+([^\\s]+)$/m.test(versionText);\n}","tryCatchPattern":"try {\n  verifyToollessSupport();\n} catch (err) {\n  if (err.message.includes('could not be verified')) {\n    console.error('Unrecognized `codex --version` output:', err.message);\n  } else throw err;\n}","preventionTips":["Check `codex --version` output format after any Codex upgrade","Avoid wrapper shims that prepend extra output to the binary","Run the binary directly rather than through npx/snap layers","Add a CI assertion that the version banner matches the expected regex"],"tags":["cli","codex","version-check","output-parsing"],"backgroundTag":"unexpected-response-shape","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"}