affaan-m/ECC · error · Error

--host-provider must be anthropic, openai, or unknown

Error message

--host-provider must be anthropic, openai, or unknown

What it means

Thrown by parseArgs() after the loop when options.hostProvider is null or not in the HOST_PROVIDERS set (anthropic, openai, unknown). The host provider labels the provider-relationship of the critique (cross-provider vs same-provider vs unverified), which is prepended to the review output. It is mandatory because the label is load-bearing for how the critique is interpreted.

Source

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

      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',
    '--ephemeral',
    '--ignore-user-config',
    '--ignore-rules',

View on GitHub (pinned to 01e15490f0)

Solutions

  1. Pass one of anthropic, openai, or unknown: `--host-provider anthropic`.
  2. Use 'unknown' when you cannot verify the hosting relationship; the output will say 'provider relationship unverified'.
  3. Ensure the value is a separate argv token (no = form, no missing value).

Example fix

// before
node skills/council-multi-model/scripts/review-with-codex.js --consent-to-openai

// after
node skills/council-multi-model/scripts/review-with-codex.js --consent-to-openai --host-provider anthropic
Defensive patterns

Strategy: validation

Validate before calling

const HOST_PROVIDERS = new Set(['anthropic', 'openai', 'unknown']);
function ensureHostProvider(value) {
  if (!HOST_PROVIDERS.has(value)) {
    throw new Error('--host-provider must be anthropic, openai, or unknown');
  }
  return value;
}

Type guard

function isHostProvider(value) {
  return value === 'anthropic' || value === 'openai' || value === 'unknown';
}

Prevention

When it happens

Trigger: Omitting --host-provider entirely (it defaults to null); passing an unsupported value like --host-provider google or --host-provider azure. Note --host-provider must be followed by the value token; the parser consumes argv[index+1].

Common situations: Forgetting the flag; passing a provider name that is not in the allowed set; typo (e.g. --host-providers); leaving the value off so the next flag is consumed as the provider string.

Related errors


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