{"record":{"id":"7d0eb356cdfaada2","repo":"can1357/oh-my-pi","slug":"prompt-requires-profile-chat-or-generation","errorCode":null,"errorMessage":"--prompt requires --profile chat or generation","messagePattern":"--prompt requires --profile chat or generation","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/cli/bench-cli.ts","lineNumber":879,"sourceCode":"\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}\n\n\tconst cachePairs = cacheMode\n\t\t? normalizePositiveInteger(\"cache-pairs\", command.flags.cachePairs, DEFAULT_CACHE_PAIRS)\n\t\t: undefined;\n\tconst cacheConcurrency = cacheMode\n\t\t? normalizePositiveInteger(\"cache-concurrency\", command.flags.cacheConcurrency, DEFAULT_CACHE_CONCURRENCY)\n\t\t: undefined;\n\tconst runs = cacheMode\n\t\t? cachePairs! * 2\n\t\t: normalizePositiveInteger(\"runs\", command.flags.runs, PROFILE_DEFAULT_RUNS[profile]);\n\tconst maxTokensOverride =\n\t\tcommand.flags.maxTokens !== undefined\n\t\t\t? normalizePositiveInteger(\"max-tokens\", command.flags.maxTokens, 1)\n\t\t\t: undefined;","sourceCodeStart":861,"sourceCodeEnd":897,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/cli/bench-cli.ts#L861-L897","documentation":"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).","triggerScenarios":"Running e.g. `omp bench sonnet --prompt \"hi\" --profile mix` or `--prompt \"hi\" --profile prefill` (with --cache absent).","commonSituations":"Passing --prompt with the default profile (mix) without realizing the default isn't chat; scripts that always include --prompt.","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"],"exampleFix":"// before\nomp bench sonnet --prompt \"Explain quines\"\n// after\nomp bench sonnet --prompt \"Explain quines\" --profile chat","handlingStrategy":"validation","validationCode":"if (args.prompt !== undefined && !(args.profile === \"chat\" || args.profile === \"generation\"))\n  throw new Error(\"--prompt requires --profile chat or generation\");","typeGuard":null,"tryCatchPattern":"try {\n  await runBench(argv);\n} catch (err) {\n  if (err instanceof Error && err.message.includes(\"--prompt requires\")) {\n    console.error(\"Add --profile chat/generation, or drop --prompt.\");\n    process.exitCode = 2;\n  } else throw err;\n}","preventionTips":["Always pair --prompt with an explicit --profile chat or generation","Avoid passing --prompt with the default (mix) profile"],"tags":["cli","flag-validation","dependency-flags"],"backgroundTag":"missing-required-flag-combination","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}