affaan-m/ECC · error · Error
unknown argument: ${arg}
Error message
unknown argument: ${arg} What it means
Thrown by parseArgs() in review-with-codex.js for any argv token that is not one of --consent-to-openai, --host-provider, --timeout-seconds, --help, or -h. The parser is intentionally strict: the review script sends prompts to a third-party LLM, so unrecognized flags are rejected rather than silently ignored.
Source
Thrown at skills/council-multi-model/scripts/review-with-codex.js:74
for (let index = 0; index < argv.length; index += 1) {
const arg = argv[index];
if (arg === '--consent-to-openai') {
options.consent = true;
} else if (arg === '--host-provider') {
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';
}View on GitHub (pinned to 01e15490f0)
Solutions
- Strip unsupported flags; the script only accepts --consent-to-openai, --host-provider <p>, --timeout-seconds <n>, --help.
- Pass multi-part values as the next token, not as --flag=value.
- Feed the review packet on stdin, not as an argument.
Example fix
// before node skills/council-multi-model/scripts/review-with-codex.js --consent-to-openai --host-provider=anthropic --model gpt-4 // after echo "$REVIEW_PACKET" | node skills/council-multi-model/scripts/review-with-codex.js --consent-to-openai --host-provider anthropic
Defensive patterns
Strategy: validation
Validate before calling
const REVIEW_FLAGS = new Set(['--consent-to-openai', '--host-provider', '--timeout-seconds', '--help', '-h']);
function assertReviewFlag(arg) {
if (!REVIEW_FLAGS.has(arg)) {
throw new Error(`unknown argument: ${arg}`);
}
} Type guard
function isReviewFlag(arg) {
return ['--consent-to-openai', '--host-provider', '--timeout-seconds', '--help', '-h'].includes(arg);
} Prevention
- Only pass the four supported flags; this script does not share flags with other ECC tools.
- Use space-separated --flag value form, never --flag=value.
- Feed the review packet on stdin, not as an argument.
When it happens
Trigger: Passing any unsupported flag, e.g. --model, --verbose, --repo, --prompt, or a positional argument. Note the parser does not support --flag=value form either: `--host-provider=anthropic` is treated as an unknown argument.
Common situations: Assuming the script shares flags with work-items.js or other ECC tools; using =-glued flags; passing the prompt as a positional instead of via stdin (the prompt must come on stdin).
Related errors
- ${label} must be a positive integer
- Unknown install target: ${parsed.target}. Expected one of ${
- Invalid ${flagName}: ${value}
- Invalid format: ${parsed.format}. Use text, json, or markdow
- --write requires --json, --markdown, or --format json|markdo
AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13).
Data as JSON: /api/errors/5998c591b127f208.
Report an issue: GitHub.