{"record":{"id":"fe5e16ee2b22107a","repo":"can1357/oh-my-pi","slug":"par-cannot-parallelize-cold-warm-pairs-use-ca","errorCode":null,"errorMessage":"--par cannot parallelize cold/warm pairs; use --cache-concurrency instead","messagePattern":"--par cannot parallelize cold/warm pairs; use --cache-concurrency instead","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/cli/bench-cli.ts","lineNumber":865,"sourceCode":"\t\t\t\"--cache is not supported for openai-codex-responses because Codex WebSocket chaining cannot produce independent prompt-cache pairs\",\n\t\t);\n\t}\n}\n\nexport async function runBenchCommand(command: BenchCommandArgs, deps: BenchDependencies = {}): Promise<BenchSummary> {\n\tconst cacheMode = command.flags.cache === true;\n\tconst cacheFlagsUsed =\n\t\tcommand.flags.cachePrefixFile !== undefined ||\n\t\tcommand.flags.cachePrefixBytes !== undefined ||\n\t\tcommand.flags.cachePairs !== undefined ||\n\t\tcommand.flags.cacheConcurrency !== undefined;\n\tif (!cacheMode && cacheFlagsUsed) throw new Error(\"Cache flags require --cache\");\n\tif (cacheMode && command.flags.runs !== undefined)\n\t\tthrow new Error(\"Use --cache-pairs instead of --runs with --cache\");\n\tif (cacheMode && command.flags.prompt !== undefined) throw new Error(\"--cache builds its own stable-prefix prompts\");\n\tif (cacheMode && command.flags.profile !== undefined) throw new Error(\"--profile cannot be combined with --cache\");\n\tif (cacheMode && (command.flags.par ?? 1) > 1) {\n\t\tthrow new Error(\"--par cannot parallelize cold/warm pairs; use --cache-concurrency instead\");\n\t}\n\tconst profileFlag = command.flags.profile;\n\tif (\n\t\tprofileFlag !== undefined &&\n\t\tprofileFlag !== \"mix\" &&\n\t\tprofileFlag !== \"chat\" &&\n\t\tprofileFlag !== \"prefill\" &&\n\t\tprofileFlag !== \"generation\"\n\t) {\n\t\tthrow new Error(`Unknown --profile \"${profileFlag}\" (expected mix, chat, prefill, or generation)`);\n\t}\n\tconst profile: BenchProfile = profileFlag ?? \"mix\";\n\tif (!cacheMode && command.flags.prompt !== undefined && profile !== \"chat\" && profile !== \"generation\") {\n\t\tthrow new Error(\"--prompt requires --profile chat or generation\");\n\t}\n\tif (command.flags.prefillBytes !== undefined && (cacheMode || (profile !== \"mix\" && profile !== \"prefill\"))) {\n\t\tthrow new Error(\"--prefill-bytes requires prefill challenges (--profile mix or prefill)\");\n\t}","sourceCodeStart":847,"sourceCodeEnd":883,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/cli/bench-cli.ts#L847-L883","documentation":"--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.","triggerScenarios":"Running `omp bench sonnet --cache --par 4` — cacheMode is true and command.flags.par ?? 1 exceeds 1.","commonSituations":"Reusing a --par flag from non-cache bench runs while switching to --cache; assuming parallelism settings carry over between modes.","solutions":["Replace --par with --cache-concurrency N to run multiple cold/warm pairs in parallel","Remove --par entirely to run pairs sequentially (default)","Run without --cache if you specifically want --par parallelism over runs"],"exampleFix":"// before\nomp bench sonnet --cache --par 4\n// after\nomp bench sonnet --cache --cache-concurrency 4","handlingStrategy":"validation","validationCode":"if (useCacheMode && (args.par ?? 1) > 1) throw new Error(\"Use --cache-concurrency instead of --par in cache mode\");","typeGuard":null,"tryCatchPattern":"try {\n  await runBench(argv);\n} catch (err) {\n  if (err instanceof Error && err.message.includes(\"--cache-concurrency\")) {\n    console.error(\"Swap --par for --cache-concurrency in cache mode.\");\n    process.exitCode = 2;\n  } else throw err;\n}","preventionTips":["Remember pairs are sequential cold→warm; parallelize across pairs with --cache-concurrency","Remove global --par defaults from bench wrappers"],"tags":["cli","flag-validation","cache-benchmark","parallelism"],"backgroundTag":"conflicting-cli-flags","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}