{"record":{"id":"d43df66328fd537d","repo":"can1357/oh-my-pi","slug":"prefill-bytes-requires-prefill-challenges-pro","errorCode":null,"errorMessage":"--prefill-bytes requires prefill challenges (--profile mix or prefill)","messagePattern":"--prefill-bytes requires prefill challenges \\(--profile mix or prefill\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/cli/bench-cli.ts","lineNumber":882,"sourceCode":"\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;\n\tconst cacheMaxTokens = cacheMode ? (maxTokensOverride ?? DEFAULT_CACHE_MAX_TOKENS) : undefined;\n\tconst par =\n\t\tcommand.flags.par !== undefined ? normalizePositiveInteger(\"par\", command.flags.par, DEFAULT_PAR) : DEFAULT_PAR;","sourceCodeStart":864,"sourceCodeEnd":900,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/cli/bench-cli.ts#L864-L900","documentation":"--prefill-bytes only applies to benchmarks whose workload exercises prompt prefill caching — the mix or prefill profiles. It is also meaningless in --cache mode, which sizes prefixes itself. The CLI throws when prefillBytes is set under cache mode or a chat/generation profile.","triggerScenarios":"Running `omp bench sonnet --prefill-bytes 20000` (default profile is mix — wait, mix is allowed, so the trigger is: --prefill-bytes with --profile chat/generation, or with --cache).","commonSituations":"Leftover --prefill-bytes flag in scripts switched to chat/generation profiles; combining cache benchmarks with prefill sizing flags; forgetting that the default mix profile is one of the few that accepts it.","solutions":["Use --profile mix or --profile prefill when passing --prefill-bytes (without --cache)","Remove --prefill-bytes if benchmarking chat or generation workloads","In cache mode, use --cache-prefix-bytes / --cache-prefix-file instead of --prefill-bytes"],"exampleFix":"// before\nomp bench sonnet --prefill-bytes 20000 --profile chat\n// after\nomp bench sonnet --prefill-bytes 20000 --profile prefill","handlingStrategy":"validation","validationCode":"if (args.prefillBytes !== undefined && (useCacheMode || !(args.profile === \"mix\" || args.profile === \"prefill\")))\n  throw new Error(\"--prefill-bytes requires --profile mix or prefill and no --cache\");","typeGuard":null,"tryCatchPattern":"try {\n  await runBench(argv);\n} catch (err) {\n  if (err instanceof Error && err.message.includes(\"--prefill-bytes requires\")) {\n    console.error(\"Use --profile mix or prefill for --prefill-bytes; in cache mode use --cache-prefix-*.\");\n    process.exitCode = 2;\n  } else throw err;\n}","preventionTips":["Gate --prefill-bytes behind mix/prefill profiles in generated commands","Use --cache-prefix-bytes/--cache-prefix-file for cache mode instead"],"tags":["cli","flag-validation","dependency-flags"],"backgroundTag":"invalid-enum-value","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}