{"record":{"id":"817cf77a0c5ea806","repo":"can1357/oh-my-pi","slug":"unknown-profile-profileflag-expected-mix","errorCode":null,"errorMessage":"Unknown --profile \"${profileFlag}\" (expected mix, chat, prefill, or generation)","messagePattern":"Unknown --profile \"(.+?)\" \\(expected mix, chat, prefill, or generation\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/cli/bench-cli.ts","lineNumber":875,"sourceCode":"\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}\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]);","sourceCodeStart":857,"sourceCodeEnd":893,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/cli/bench-cli.ts#L857-L893","documentation":"The bench CLI validates --profile against a fixed whitelist: mix, chat, prefill, generation. Any other string is rejected before execution so typos fail fast rather than silently defaulting.","triggerScenarios":"Passing --profile with a misspelled or unsupported value, e.g. `--profile Chat`, `--profile mixed`, `--profile realtime`.","commonSituations":"Typos or casing mistakes; copying profile names from other benchmark tools; outdated scripts referencing a removed profile name.","solutions":["Use one of the four supported profiles: mix, chat, prefill, or generation (lowercase)","Omit --profile entirely to get the default \"mix\" profile","Check `omp bench --help` for the current list of accepted profile values"],"exampleFix":"// before\nomp bench sonnet --profile Chat\n// after\nomp bench sonnet --profile chat","handlingStrategy":"validation","validationCode":"const PROFILES = [\"mix\",\"chat\",\"prefill\",\"generation\"];\nif (args.profile !== undefined && !PROFILES.includes(args.profile))\n  throw new Error(`--profile must be one of ${PROFILES.join(\", \")}`);","typeGuard":"function isBenchProfile(v: string): v is \"mix\"|\"chat\"|\"prefill\"|\"generation\" {\n  return [\"mix\",\"chat\",\"prefill\",\"generation\"].includes(v);\n}","tryCatchPattern":"try {\n  await runBench(argv);\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith(\"Unknown --profile\")) {\n    console.error(\"Use mix, chat, prefill, or generation (lowercase).\");\n    process.exitCode = 2;\n  } else throw err;\n}","preventionTips":["Only pass profile strings from the fixed whitelist; never free-form user input","Lowercase/trim profile input before passing it through"],"tags":["cli","flag-validation","invalid-enum-value"],"backgroundTag":"invalid-enum-value","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}