can1357/oh-my-pi · error

Pass at least one model selector, e.g. `omp bench opus gpt-5

Error message

Pass at least one model selector, e.g. `omp bench opus gpt-5.2`

What it means

The bench command requires at least one model selector as a positional argument (e.g. `omp bench opus gpt-5.2`). With an empty model list there is nothing to benchmark, so the CLI throws before creating the live progress board.

Source

Thrown at packages/coding-agent/src/cli/bench-cli.ts:920

	const prefillBytes = normalizePositiveInteger("prefill-bytes", command.flags.prefillBytes, DEFAULT_PREFILL_BYTES);
	const kinds: readonly BenchChallengeKind[] = profile === "mix" ? CHALLENGE_KINDS : [profile];
	const random = deps.random ?? Math.random;
	const json = command.flags.json === true;
	const randomSessionId = deps.randomSessionId ?? (() => Bun.randomUUIDv7());
	const readTextFile = deps.readTextFile ?? readBoundedUtf8File;
	const cachePrefix = cacheMode ? await resolveCachePrefix(command.flags, readTextFile) : undefined;
	const writeStdout = deps.writeStdout ?? ((text: string) => process.stdout.write(text));
	const writeStderr = deps.writeStderr ?? ((text: string) => process.stderr.write(text));
	const setExitCode =
		deps.setExitCode ??
		((code: number) => {
			process.exitCode = code;
		});
	const streamFn = deps.streamSimple ?? streamSimple;
	const now = deps.now ?? (() => performance.now());
	const interactive = deps.stdoutIsTTY ?? process.stdout.isTTY === true;
	if (command.models.length === 0) {
		throw new Error("Pass at least one model selector, e.g. `omp bench opus gpt-5.2`");
	}
	let progress: BenchLiveProgress | undefined;
	const board = json
		? undefined
		: createLiveBoard(spinner => renderBenchProgress(progress, spinner), {
				isTTY: interactive,
				get columns() {
					return process.stdout.columns;
				},
				get rows() {
					return process.stdout.rows;
				},
				write(text: string): boolean {
					writeStdout(text);
					return true;
				},
			} satisfies LiveBoardOutput);
	const print = (text: string): void => {

View on GitHub (pinned to 9690622007)

Solutions

  1. Pass at least one model selector: `omp bench opus` or `omp bench opus gpt-5.2`
  2. Verify the variable holding model names is non-empty before invoking the command
  3. Check `omp bench --help` for selector syntax

Example fix

// before
omp bench
// after
omp bench opus gpt-5.2
Defensive patterns

Strategy: validation

Validate before calling

const selectors = argv.filter(a => !a.startsWith("--"));
if (selectors.length === 0) throw new Error("omp bench needs at least one model selector, e.g. `omp bench opus`");

Try / catch

try {
  await runBench(argv);
} catch (err) {
  if (err instanceof Error && err.message.includes("at least one model selector")) {
    console.error("Usage: omp bench <model-selector>...");
    process.exitCode = 2;
  } else throw err;
}

Prevention

When it happens

Trigger: Running `omp bench` with no positional model selectors.

Common situations: Forgetting the subcommand arguments entirely; shell variable holding model names expanding to empty; wrapping `omp bench` in a script where args are passed conditionally.

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/8e8877ad159c24cd. Report an issue: GitHub.