can1357/oh-my-pi · error

Unknown --profile "${profileFlag}" (expected mix, chat, pref

Error message

Unknown --profile "${profileFlag}" (expected mix, chat, prefill, or generation)

What it means

The bench CLI validates --profile against a fixed whitelist: mix, chat, prefill, generation. Any other string is rejected before execution so typos fail fast rather than silently defaulting.

Source

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

		command.flags.cachePairs !== undefined ||
		command.flags.cacheConcurrency !== undefined;
	if (!cacheMode && cacheFlagsUsed) throw new Error("Cache flags require --cache");
	if (cacheMode && command.flags.runs !== undefined)
		throw new Error("Use --cache-pairs instead of --runs with --cache");
	if (cacheMode && command.flags.prompt !== undefined) throw new Error("--cache builds its own stable-prefix prompts");
	if (cacheMode && command.flags.profile !== undefined) throw new Error("--profile cannot be combined with --cache");
	if (cacheMode && (command.flags.par ?? 1) > 1) {
		throw new Error("--par cannot parallelize cold/warm pairs; use --cache-concurrency instead");
	}
	const profileFlag = command.flags.profile;
	if (
		profileFlag !== undefined &&
		profileFlag !== "mix" &&
		profileFlag !== "chat" &&
		profileFlag !== "prefill" &&
		profileFlag !== "generation"
	) {
		throw new Error(`Unknown --profile "${profileFlag}" (expected mix, chat, prefill, or generation)`);
	}
	const profile: BenchProfile = profileFlag ?? "mix";
	if (!cacheMode && command.flags.prompt !== undefined && profile !== "chat" && profile !== "generation") {
		throw new Error("--prompt requires --profile chat or generation");
	}
	if (command.flags.prefillBytes !== undefined && (cacheMode || (profile !== "mix" && profile !== "prefill"))) {
		throw new Error("--prefill-bytes requires prefill challenges (--profile mix or prefill)");
	}

	const cachePairs = cacheMode
		? normalizePositiveInteger("cache-pairs", command.flags.cachePairs, DEFAULT_CACHE_PAIRS)
		: undefined;
	const cacheConcurrency = cacheMode
		? normalizePositiveInteger("cache-concurrency", command.flags.cacheConcurrency, DEFAULT_CACHE_CONCURRENCY)
		: undefined;
	const runs = cacheMode
		? cachePairs! * 2
		: normalizePositiveInteger("runs", command.flags.runs, PROFILE_DEFAULT_RUNS[profile]);

View on GitHub (pinned to 9690622007)

Solutions

  1. Use one of the four supported profiles: mix, chat, prefill, or generation (lowercase)
  2. Omit --profile entirely to get the default "mix" profile
  3. Check `omp bench --help` for the current list of accepted profile values

Example fix

// before
omp bench sonnet --profile Chat
// after
omp bench sonnet --profile chat
Defensive patterns

Strategy: validation

Validate before calling

const PROFILES = ["mix","chat","prefill","generation"];
if (args.profile !== undefined && !PROFILES.includes(args.profile))
  throw new Error(`--profile must be one of ${PROFILES.join(", ")}`);

Type guard

function isBenchProfile(v: string): v is "mix"|"chat"|"prefill"|"generation" {
  return ["mix","chat","prefill","generation"].includes(v);
}

Try / catch

try {
  await runBench(argv);
} catch (err) {
  if (err instanceof Error && err.message.startsWith("Unknown --profile")) {
    console.error("Use mix, chat, prefill, or generation (lowercase).");
    process.exitCode = 2;
  } else throw err;
}

Prevention

When it happens

Trigger: Passing --profile with a misspelled or unsupported value, e.g. `--profile Chat`, `--profile mixed`, `--profile realtime`.

Common situations: Typos or casing mistakes; copying profile names from other benchmark tools; outdated scripts referencing a removed profile name.

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 can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/817cf77a0c5ea806. Report an issue: GitHub.