{"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/01e15490f04e29cfefe3896951f43db46994d8ee/skills/council-multi-model/scripts/review-with-codex.js#L124-L160","documentation":"Thrown by verifyToollessSupport() when `codex --version` ran successfully (probe returned 0) but its stdout did not match the regex /^codex-cli\\s+([^\\s]+)$/m. The script pins a specific supported Codex version and needs to parse the exact version string; an unexpected output format (a rebranded binary, a wrapper, a locale-formatted line) means the version cannot be trusted for the tool-less safety contract.","triggerScenarios":"A binary named codex that is not the real Codex CLI (a shim, alias, or different product); a Codex build whose --version output format changed (e.g. extra prefix text, different binary name); stdout polluted by a shell RC file or wrapper script so the first match line is not the version.","commonSituations":"A custom `codex` wrapper on PATH; an alias that prepends text; a different product also named codex; a preview/nightly build with a different version-string format.","solutions":["Run `codex --version` by hand and confirm it prints a line like `codex-cli <version>`.","Remove or rename any wrapper/alias that shadows the real Codex binary.","Ensure the shell RC does not print extra lines on non-interactive spawn (buildEnvironment tries to isolate this)."],"exampleFix":"// before: a wrapper shadows codex\n$ codex --version\nmy-codex-wrapper v1.2.3\n\n// after\n$ unalias codex; rm ~/bin/codex  # remove the wrapper\n$ hash -r\n$ codex --version\ncodex-cli 0.146.0","handlingStrategy":"validation","validationCode":"function parseCodexVersion(stdout) {\n  const m = (stdout || '').match(/^codex-cli\\s+([^\\s]+)$/m);\n  if (!m) throw new Error('Codex version could not be verified for tool-less review');\n  return m[1];\n}\n// call parseCodexVersion(spawnSync('codex', ['--version'], opts).stdout) before relying on the version","typeGuard":"function looksLikeCodexCliVersion(stdout) {\n  return /^codex-cli\\s+[^\\s]+$/m.test(stdout || '');\n}","tryCatchPattern":"try {\n  verifyToollessSupport({ spawnSync });\n} catch (error) {\n  if (/Codex version could not be verified/.test(error.message)) {\n    // remove wrapper/alias shadowing codex, then retry\n  } else {\n    throw error;\n  }\n}","preventionTips":["Confirm `codex --version` prints a `codex-cli <version>` line with no extra prefix.","Remove any wrapper/alias that shadows the real Codex binary.","Keep shell RC files quiet on non-interactive spawn so stdout is clean."],"tags":["runtime","environment","codex","version","verification","regex"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}