can1357/oh-my-pi · error · Error

at least one --model is required

Error message

at least one --model is required

What it means

After option parsing, parseArgs enforces that at least one model was supplied via -m/--model (repeatable). An empty models array (and no --help) throws this error.

Source

Thrown at packages/metaharness/src/tb/cli.ts:201

				config.vmonUrl = take();
				break;
			case "--vmon-token":
				config.vmonToken = take();
				break;
			case "--list":
				config.list = true;
				break;
			case "-h":
			case "--help":
				config.help = true;
				break;
			default:
				throw new Error(`unknown option: ${arg}`);
		}
	}

	if (config.help) return config;
	if (config.models.length === 0) throw new Error("at least one --model is required");
	for (const model of config.models) {
		const slash = model.indexOf("/");
		if (slash <= 0 || slash === model.length - 1) throw new Error(`invalid model ${model}; expected provider/model`);
	}
	for (const [flag, value] of [
		["--attempts", config.attempts],
		["--concurrency", config.concurrency],
		["--epochs", config.epochs],
	] as const) {
		if (!Number.isInteger(value) || value < 1) throw new Error(`${flag} must be a positive integer`);
	}
	if (config.budget !== null && (!Number.isFinite(config.budget) || config.budget < 0)) {
		throw new Error("--budget must be a non-negative number");
	}
	return config;
}

class Semaphore {

View on GitHub (pinned to 9690622007)

Solutions

  1. Add at least one --model provider/model flag
  2. Repeat -m/--model for each model to test
  3. Pass bare model names positionally? No — use the flag; positionals are not accepted for models

Example fix

// before
$ tb --attempts 2
// after
$ tb --attempts 2 --model anthropic/claude-sonnet-4
Defensive patterns

Strategy: validation

Validate before calling

if (!process.argv.slice(2).some(a => a === "-m" || a === "--model" || a.startsWith("--model="))) {
  throw new Error("tb requires at least one --model provider/model");
}

Try / catch

try {
  config = parseArgs(args);
} catch (err) {
  if (String(err.message).includes("--model is required")) {
    console.error("usage: tb -m <provider/model> [-m <provider/model> ...]");
    process.exit(2);
  }
  throw err;
}

Prevention

When it happens

Trigger: Running `tb` (or with only non-model flags like --attempts 3) without any -m/--model occurrence.

Common situations: First-time users omitting the required flag; scripts where a MODELS variable was empty so the -m flags were never emitted; confusing --model with a positional argument and passing 'x/y' bare.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/c0d143852b9a5ca5. Report an issue: GitHub.