affaan-m/ECC · error · Error

explicit --consent-to-openai is required

Error message

explicit --consent-to-openai is required

What it means

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).

Solutions

  1. Add --consent-to-openai to the invocation to acknowledge OpenAI API usage.
  2. Use --help (-h) first if you only want to see usage — help returns before the consent check.
  3. In CI, add the flag explicitly to the workflow step so the run is an intentional opt-in.
  4. If you don't want any OpenAI calls, do not run this script; use a single-model review flow instead.

Example fix

// before
node review-with-codex.js --host-provider anthropic
// Error: explicit --consent-to-openai is required

// after
node review-with-codex.js --host-provider anthropic --consent-to-openai
Defensive patterns

Strategy: validation

Validate before calling

if (!process.argv.includes('--consent-to-openai')) {
  console.error('This script calls OpenAI; re-run with --consent-to-openai to opt in.');
  process.exit(2);
}

Type guard

const hasConsent = (argv) => argv.includes('--consent-to-openai');

Try / catch

try {
  run(args);
} catch (e) {
  if (String(e.message).includes('--consent-to-openai is required')) {
    console.error('Add --consent-to-openai to acknowledge OpenAI API usage.');
  }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "--flag is required" and "must specify" CLI errors: how missing-required-flag validation works and how to fix it — this error's family across 20 libraries.

Related errors


AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16). Data as JSON: /api/errors/e602a5a41650c54a. Report an issue: GitHub.

Appendix: source

Thrown at skills/council-multi-model/scripts/review-with-codex.js:80

      options.hostProvider = argv[index + 1];
      index += 1;
    } else if (arg === '--timeout-seconds') {
      const seconds = Number(argv[index + 1]);
      if (!Number.isInteger(seconds) || seconds < 10 || seconds > 120) {
        throw new Error('--timeout-seconds must be an integer from 10 to 120');
      }
      options.timeoutMs = seconds * 1000;
      index += 1;
    } else if (arg === '--help' || arg === '-h') {
      options.help = true;
    } else {
      throw new Error(`unknown argument: ${arg}`);
    }
  }

  if (options.help) return options;
  if (!options.consent) {
    throw new Error('explicit --consent-to-openai is required');
  }
  if (!HOST_PROVIDERS.has(options.hostProvider)) {
    throw new Error('--host-provider must be anthropic, openai, or unknown');
  }
  return options;
}

function providerLabel(hostProvider) {
  if (hostProvider === 'anthropic') return 'cross-provider external critique';
  if (hostProvider === 'openai') return 'same-provider external critique';
  return 'provider relationship unverified';
}

function buildCodexArgs(tempDir, outputFile) {
  return [
    '--ask-for-approval', 'never',
    ...REQUIRED_TOOLLESS_FEATURES.flatMap((feature) => ['--disable', feature]),
    'exec',

View on GitHub (pinned to 8321021c54)