can1357/oh-my-pi · error
--prompt requires --profile chat or generation
Error message
--prompt requires --profile chat or generation
What it means
A custom --prompt only makes sense for workloads that use a single user prompt (chat or generation profiles). The mix profile builds its own multi-segment workload and prefill uses prefix prefill bytes, so --prompt would be ignored; the CLI rejects the combination (only when not in --cache mode, which has its own prompt rules).
Source
Thrown at packages/coding-agent/src/cli/bench-cli.ts:879
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]);
const maxTokensOverride =
command.flags.maxTokens !== undefined
? normalizePositiveInteger("max-tokens", command.flags.maxTokens, 1)
: undefined;View on GitHub (pinned to 9690622007)
Solutions
- Add --profile chat or --profile generation when passing --prompt
- Remove --prompt if you want the default mix workload
- Use --prefill-bytes with --profile prefill instead if you intend a prefill benchmark
Example fix
// before omp bench sonnet --prompt "Explain quines" // after omp bench sonnet --prompt "Explain quines" --profile chat
Defensive patterns
Strategy: validation
Validate before calling
if (args.prompt !== undefined && !(args.profile === "chat" || args.profile === "generation"))
throw new Error("--prompt requires --profile chat or generation"); Try / catch
try {
await runBench(argv);
} catch (err) {
if (err instanceof Error && err.message.includes("--prompt requires")) {
console.error("Add --profile chat/generation, or drop --prompt.");
process.exitCode = 2;
} else throw err;
} Prevention
- Always pair --prompt with an explicit --profile chat or generation
- Avoid passing --prompt with the default (mix) profile
When it happens
Trigger: Running e.g. `omp bench sonnet --prompt "hi" --profile mix` or `--prompt "hi" --profile prefill` (with --cache absent).
Common situations: Passing --prompt with the default profile (mix) without realizing the default isn't chat; scripts that always include --prompt.
Related errors
- --prefill-bytes requires prefill challenges (--profile mix o
- Use --cache-pairs instead of --runs with --cache
- --cache builds its own stable-prefix prompts
- --profile cannot be combined with --cache
- --par cannot parallelize cold/warm pairs; use --cache-concur
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/7d0eb356cdfaada2.
Report an issue: GitHub.