{"record":{"id":"e602a5a41650c54a","repo":"affaan-m/ECC","slug":"explicit-consent-to-openai-is-required","errorCode":null,"errorMessage":"explicit --consent-to-openai is required","messagePattern":"explicit --consent-to-openai is required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"skills/council-multi-model/scripts/review-with-codex.js","lineNumber":80,"sourceCode":"      options.hostProvider = argv[index + 1];\n      index += 1;\n    } else if (arg === '--timeout-seconds') {\n      const seconds = Number(argv[index + 1]);\n      if (!Number.isInteger(seconds) || seconds < 10 || seconds > 120) {\n        throw new Error('--timeout-seconds must be an integer from 10 to 120');\n      }\n      options.timeoutMs = seconds * 1000;\n      index += 1;\n    } else if (arg === '--help' || arg === '-h') {\n      options.help = true;\n    } else {\n      throw new Error(`unknown argument: ${arg}`);\n    }\n  }\n\n  if (options.help) return options;\n  if (!options.consent) {\n    throw new Error('explicit --consent-to-openai is required');\n  }\n  if (!HOST_PROVIDERS.has(options.hostProvider)) {\n    throw new Error('--host-provider must be anthropic, openai, or unknown');\n  }\n  return options;\n}\n\nfunction providerLabel(hostProvider) {\n  if (hostProvider === 'anthropic') return 'cross-provider external critique';\n  if (hostProvider === 'openai') return 'same-provider external critique';\n  return 'provider relationship unverified';\n}\n\nfunction buildCodexArgs(tempDir, outputFile) {\n  return [\n    '--ask-for-approval', 'never',\n    ...REQUIRED_TOOLLESS_FEATURES.flatMap((feature) => ['--disable', feature]),\n    'exec',","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/council-multi-model/scripts/review-with-codex.js#L62-L98","documentation":"review-with-codex.js sends prompts to the Codex CLI, which bills against OpenAI credentials. To prevent accidental paid API usage, parseArgs requires the explicit opt-in flag --consent-to-openai and throws this error when options.consent is falsy after parsing (and when --help was not passed, since help short-circuits earlier).","triggerScenarios":"Running the script without `--consent-to-openai` in the argument list. The check runs after the parse loop and after the --help early-return, so any real invocation lacking the flag throws.","commonSituations":"First-time user unaware of the consent requirement; CI pipeline invoking the script without the flag after a tool update added the requirement; someone intentionally skipping consent hoping for a dry run.","solutions":["Add --consent-to-openai to the invocation to acknowledge OpenAI API usage.","Use --help (-h) first if you only want to see usage — help returns before the consent check.","In CI, add the flag explicitly to the workflow step so the run is an intentional opt-in.","If you don't want any OpenAI calls, do not run this script; use a single-model review flow instead."],"exampleFix":"// before\nnode review-with-codex.js --host-provider anthropic\n// Error: explicit --consent-to-openai is required\n\n// after\nnode review-with-codex.js --host-provider anthropic --consent-to-openai","handlingStrategy":"validation","validationCode":"if (!process.argv.includes('--consent-to-openai')) {\n  console.error('This script calls OpenAI; re-run with --consent-to-openai to opt in.');\n  process.exit(2);\n}","typeGuard":"const hasConsent = (argv) => argv.includes('--consent-to-openai');","tryCatchPattern":"try {\n  run(args);\n} catch (e) {\n  if (String(e.message).includes('--consent-to-openai is required')) {\n    console.error('Add --consent-to-openai to acknowledge OpenAI API usage.');\n  }\n}","preventionTips":["Bake --consent-to-openai into any wrapper or CI step that invokes this script.","Document the consent requirement where the script is introduced to the team.","Use --help to inspect requirements before first real run."],"tags":["cli","consent","missing-flag"],"backgroundTag":"missing-required-flag","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"}