{"record":{"id":"ebf449c6185f5a1a","repo":"can1357/oh-my-pi","slug":"profile-cannot-be-combined-with-cache","errorCode":null,"errorMessage":"--profile cannot be combined with --cache","messagePattern":"--profile cannot be combined with --cache","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/cli/bench-cli.ts","lineNumber":863,"sourceCode":"\tif (targets.some(({ model }) => model.api === \"openai-codex-responses\")) {\n\t\tthrow new Error(\n\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\"))) {","sourceCodeStart":845,"sourceCodeEnd":881,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/cli/bench-cli.ts#L845-L881","documentation":"--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.","triggerScenarios":"Running `omp bench sonnet --cache --profile chat` or any --profile value combined with --cache.","commonSituations":"Copy-pasting a full runs-mode command line and appending --cache; scripts that always emit --profile for bench invocations.","solutions":["Remove --profile from the command when using --cache","If you need a specific workload profile, run cache mode and profile mode as separate bench invocations"],"exampleFix":"// before\nomp bench sonnet --cache --profile prefill\n// after\nomp bench sonnet --cache\n// or, without --cache:\nomp bench sonnet --profile prefill","handlingStrategy":"validation","validationCode":"if (useCacheMode && args.profile !== undefined) throw new Error(\"--profile does not apply to --cache mode\");","typeGuard":null,"tryCatchPattern":"try {\n  await runBench(argv);\n} catch (err) {\n  if (err instanceof Error && err.message.includes(\"--profile cannot be combined with --cache\")) {\n    console.error(\"Drop --profile in cache mode or drop --cache.\");\n    process.exitCode = 2;\n  } else throw err;\n}","preventionTips":["Treat --cache as a self-contained workload mode with its own flag set","Strip profile flags when toggling a bench script into cache mode"],"tags":["cli","flag-validation","mutually-exclusive-options"],"backgroundTag":"conflicting-cli-flags","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}