affaan-m/ECC · error · Error

OpenAI transfer consent is required

Error message

OpenAI transfer consent is required

What it means

Because runReview transmits the prompt to OpenAI via Codex, the caller must affirmatively opt in by setting options.consent to a truthy value. The consent flag is a compliance guard ensuring no packet leaves the host without an explicit acknowledgment. Without it the function aborts at line 186 before any environment is built or subprocess spawned.

Source

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

  return versionMatch[1];
}

function buildEnvironment(sourceEnv = process.env) {
  const allowed = [
    'PATH', 'HOME', 'USERPROFILE', 'CODEX_HOME',
    'TMPDIR', 'TMP', 'TEMP', 'SystemRoot', 'ComSpec', 'PATHEXT',
  ];
  return Object.fromEntries(
    allowed.filter((name) => sourceEnv[name]).map((name) => [name, sourceEnv[name]])
  );
}

function runReview(prompt, options, dependencies = {}) {
  if (!prompt.trim()) throw new Error('review packet is empty');
  if (Buffer.byteLength(prompt, 'utf8') > MAX_PROMPT_BYTES) {
    throw new Error(`review packet exceeds ${MAX_PROMPT_BYTES} bytes`);
  }
  if (!options.consent) throw new Error('OpenAI transfer consent is required');
  if (options.timeoutMs < 10_000 || options.timeoutMs > MAX_TIMEOUT_MS) {
    throw new Error('timeout is outside the 10-120 second safety range');
  }

  const spawn = dependencies.spawnSync || spawnSync;
  const environment = buildEnvironment(dependencies.env || process.env);
  const verifySupport = dependencies.verifyToollessSupport || verifyToollessSupport;
  verifySupport({ spawnSync: spawn, env: environment });
  const makeTemp = dependencies.mkdtempSync || fs.mkdtempSync;
  const readFile = dependencies.readFileSync || fs.readFileSync;
  const remove = dependencies.rmSync || fs.rmSync;
  const tempDir = makeTemp(path.join(os.tmpdir(), 'ecc-council-review-'));
  const outputFile = path.join(tempDir, 'last-message.txt');

  try {
    const result = spawn('codex', buildCodexArgs(tempDir, outputFile), {
      cwd: tempDir,
      env: environment,

View on GitHub (pinned to 01e15490f0)

Solutions

  1. Set options.consent = true (or pass --consent-to-openai on the CLI) before invoking.
  2. If calling programmatically, derive consent from an explicit user action and fail loudly if it is missing rather than defaulting.
  3. Audit wrapper code that constructs the options object to ensure consent is forwarded.

Example fix

// before
const review = runReview(packet, { timeoutMs: 60000, hostProvider: 'openai' });

// after
const review = runReview(packet, {
  consent: true,
  timeoutMs: 60000,
  hostProvider: 'openai',
});
Defensive patterns

Strategy: validation

Validate before calling

function assertConsent(options) {
  if (!options || options.consent !== true) {
    throw new Error('Refusing to run review without explicit OpenAI transfer consent.');
  }
}
assertConsent(options);

Prevention

When it happens

Trigger: Calling runReview(prompt, options) where options.consent is falsy or the key is absent. Programmatically building an options object without forwarding consent, or calling runReview directly in tests bypassing parseArgs (the CLI's --consent-to-openai flag is checked separately in parseArgs).

Common situations: Programmatic integration that forgot to set consent; tests that hand-build options; a wrapper that strips unknown keys before forwarding to runReview.

Related errors


AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13). Data as JSON: /api/errors/c93df39ede029a2c. Report an issue: GitHub.