can1357/oh-my-pi · error · Error
--openrouter-variant must be default, nitro, floor, online,
Error message
--openrouter-variant must be default, nitro, floor, online, or exacto
What it means
parseArgs validates the --openrouter-variant flag with isOpenRouterVariant, which accepts only default, nitro, floor, online, or exacto. Any other value is rejected with this error.
Source
Thrown at packages/metaharness/src/tb/cli.ts:174
case "--forever":
config.forever = true;
break;
case "--budget":
config.budget = Number(take());
break;
case "--jobs-dir":
config.jobsDir = path.resolve(take());
break;
case "--gateway-url":
config.gatewayUrl = take();
break;
case "--gateway-token":
config.gatewayToken = take();
break;
case "--openrouter-variant": {
const value = take();
if (!isOpenRouterVariant(value)) {
throw new Error("--openrouter-variant must be default, nitro, floor, online, or exacto");
}
config.openrouterVariant = value;
break;
}
case "--rebuild-agent":
config.rebuildAgent = true;
break;
case "--vmon-url":
config.vmonUrl = take();
break;
case "--vmon-token":
config.vmonToken = take();
break;
case "--list":
config.list = true;
break;
case "-h":
case "--help":View on GitHub (pinned to 9690622007)
Solutions
- Use one of: default, nitro, floor, online, exacto
- Check spelling and case (all lowercase)
- Run `tb --help` to see the accepted values
Example fix
// before $ tb --openrouter-variant=Nitro --model openrouter/x/y // after $ tb --openrouter-variant=nitro --model openrouter/x/y
Defensive patterns
Strategy: validation
Validate before calling
const VARIANTS = ["default", "nitro", "floor", "online", "exacto"] as const;
if (!VARIANTS.includes(variant)) throw new Error(`bad variant: ${variant}`); Type guard
const isOpenRouterVariant = (v: string): v is "default" | "nitro" | "floor" | "online" | "exacto" => ["default", "nitro", "floor", "online", "exacto"].includes(v);
Try / catch
try {
config = parseArgs(args);
} catch (err) {
if (String(err.message).includes("--openrouter-variant")) {
console.error(`${err.message} (got: ${variant})`);
process.exit(2);
}
throw err;
} Prevention
- Keep allowed variants in one lowercase const array
- Use shell completion or a wrapper to constrain values
- Validate variant strings from env/config files before passing
When it happens
Trigger: `tb --openrouter-variant <value>` where value is misspelled, capitalized (e.g. 'Nitro'), or an unsupported variant name.
Common situations: Typo like --openrouter-variant=nitro-fast; copying a variant name from OpenRouter docs that metaharness does not support; quoting/case drift in wrapper scripts.
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
- invalid {} argument: {}
- invalid Zero increment value: {}
- --agents must be a positive integer
- --trusted-extension requires a non-empty, non-flag value
- --trusted-extension requires an absolute path: ${trustedPath
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/65241b644ccbc120.
Report an issue: GitHub.