can1357/oh-my-pi · error

--profile cannot be combined with --cache

Error message

--profile cannot be combined with --cache

What it means

--profile selects the prompt workload mix (mix/chat/prefill/generation) used by the runs-based benchmark. Cache mode defines its own cold/warm pair workload, so a profile is meaningless there; the CLI throws this validation error to prevent silently ignoring --profile.

Source

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

	if (targets.some(({ model }) => model.api === "openai-codex-responses")) {
		throw new Error(
			"--cache is not supported for openai-codex-responses because Codex WebSocket chaining cannot produce independent prompt-cache pairs",
		);
	}
}

export async function runBenchCommand(command: BenchCommandArgs, deps: BenchDependencies = {}): Promise<BenchSummary> {
	const cacheMode = command.flags.cache === true;
	const cacheFlagsUsed =
		command.flags.cachePrefixFile !== undefined ||
		command.flags.cachePrefixBytes !== undefined ||
		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"))) {

View on GitHub (pinned to 9690622007)

Solutions

  1. Remove --profile from the command when using --cache
  2. If you need a specific workload profile, run cache mode and profile mode as separate bench invocations

Example fix

// before
omp bench sonnet --cache --profile prefill
// after
omp bench sonnet --cache
// or, without --cache:
omp bench sonnet --profile prefill
Defensive patterns

Strategy: validation

Validate before calling

if (useCacheMode && args.profile !== undefined) throw new Error("--profile does not apply to --cache mode");

Try / catch

try {
  await runBench(argv);
} catch (err) {
  if (err instanceof Error && err.message.includes("--profile cannot be combined with --cache")) {
    console.error("Drop --profile in cache mode or drop --cache.");
    process.exitCode = 2;
  } else throw err;
}

Prevention

When it happens

Trigger: Running `omp bench sonnet --cache --profile chat` or any --profile value combined with --cache.

Common situations: Copy-pasting a full runs-mode command line and appending --cache; scripts that always emit --profile for bench invocations.

Related errors


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