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

After the consent check, parseArgs validates --host-provider against the HOST_PROVIDERS set (anthropic, openai, unknown). It throws this error when the supplied value is not one of those three strings, since providerLabel and the probe logic branch on those exact values.

Solutions

  1. Use exactly one of: --host-provider anthropic, --host-provider openai, or --host-provider unknown.
  2. Fix typos so the value matches the allowlist case-sensitively (all lowercase).
  3. If you don't know the host provider, pass `unknown` rather than a guessed name.
  4. Ensure the flag is followed by its value so it doesn't consume the next argument.

Example fix

// before
node review-with-codex.js --host-provider claude --consent-to-openai
// Error: --host-provider must be anthropic, openai, or unknown

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

Strategy: validation

Validate before calling

const PROVIDERS = new Set(['anthropic','openai','unknown']);
if (!PROVIDERS.has(provider)) {
  throw new Error(`provider must be anthropic|openai|unknown, got: ${provider}`);
}

Type guard

const isHostProvider = (v) => v === 'anthropic' || v === 'openai' || v === 'unknown';

Try / catch

try {
  run(['--host-provider', provider]);
} catch (e) {
  if (String(e.message).includes('--host-provider must be')) {
    console.error('Use exactly: anthropic, openai, or unknown.');
  }
}

Prevention

When it happens

Trigger: Passing `--host-provider claude`, `--host-provider gpt`, an empty string (`--host-provider ""`), or omitting the value so the next token (or undefined) is taken as the provider and fails the set check.

Common situations: User guesses a provider name instead of using the three supported values; a wrapper interpolates an unset variable producing an empty string; a typo like `anthropic-ai`.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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

Appendix: 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 8321021c54)