can1357/oh-my-pi · error

--par cannot parallelize cold/warm pairs; use --cache-concur

Error message

--par cannot parallelize cold/warm pairs; use --cache-concurrency instead

What it means

--par parallelizes independent benchmark runs, but a cache cold/warm pair is inherently sequential (the cold request must precede the warm request on the same prefix), so --par cannot apply to pairs. The CLI directs you to --cache-concurrency, which parallelizes across pairs instead.

Source

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

			"--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"))) {
		throw new Error("--prefill-bytes requires prefill challenges (--profile mix or prefill)");
	}

View on GitHub (pinned to 9690622007)

Solutions

  1. Replace --par with --cache-concurrency N to run multiple cold/warm pairs in parallel
  2. Remove --par entirely to run pairs sequentially (default)
  3. Run without --cache if you specifically want --par parallelism over runs

Example fix

// before
omp bench sonnet --cache --par 4
// after
omp bench sonnet --cache --cache-concurrency 4
Defensive patterns

Strategy: validation

Validate before calling

if (useCacheMode && (args.par ?? 1) > 1) throw new Error("Use --cache-concurrency instead of --par in cache mode");

Try / catch

try {
  await runBench(argv);
} catch (err) {
  if (err instanceof Error && err.message.includes("--cache-concurrency")) {
    console.error("Swap --par for --cache-concurrency in cache mode.");
    process.exitCode = 2;
  } else throw err;
}

Prevention

When it happens

Trigger: Running `omp bench sonnet --cache --par 4` — cacheMode is true and command.flags.par ?? 1 exceeds 1.

Common situations: Reusing a --par flag from non-cache bench runs while switching to --cache; assuming parallelism settings carry over between modes.

Related errors


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