{"record":{"id":"8e8877ad159c24cd","repo":"can1357/oh-my-pi","slug":"pass-at-least-one-model-selector-e-g-omp-bench","errorCode":null,"errorMessage":"Pass at least one model selector, e.g. `omp bench opus gpt-5.2`","messagePattern":"Pass at least one model selector, e\\.g\\. `omp bench opus gpt-5\\.2`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/cli/bench-cli.ts","lineNumber":920,"sourceCode":"\tconst prefillBytes = normalizePositiveInteger(\"prefill-bytes\", command.flags.prefillBytes, DEFAULT_PREFILL_BYTES);\n\tconst kinds: readonly BenchChallengeKind[] = profile === \"mix\" ? CHALLENGE_KINDS : [profile];\n\tconst random = deps.random ?? Math.random;\n\tconst json = command.flags.json === true;\n\tconst randomSessionId = deps.randomSessionId ?? (() => Bun.randomUUIDv7());\n\tconst readTextFile = deps.readTextFile ?? readBoundedUtf8File;\n\tconst cachePrefix = cacheMode ? await resolveCachePrefix(command.flags, readTextFile) : undefined;\n\tconst writeStdout = deps.writeStdout ?? ((text: string) => process.stdout.write(text));\n\tconst writeStderr = deps.writeStderr ?? ((text: string) => process.stderr.write(text));\n\tconst setExitCode =\n\t\tdeps.setExitCode ??\n\t\t((code: number) => {\n\t\t\tprocess.exitCode = code;\n\t\t});\n\tconst streamFn = deps.streamSimple ?? streamSimple;\n\tconst now = deps.now ?? (() => performance.now());\n\tconst interactive = deps.stdoutIsTTY ?? process.stdout.isTTY === true;\n\tif (command.models.length === 0) {\n\t\tthrow new Error(\"Pass at least one model selector, e.g. `omp bench opus gpt-5.2`\");\n\t}\n\tlet progress: BenchLiveProgress | undefined;\n\tconst board = json\n\t\t? undefined\n\t\t: createLiveBoard(spinner => renderBenchProgress(progress, spinner), {\n\t\t\t\tisTTY: interactive,\n\t\t\t\tget columns() {\n\t\t\t\t\treturn process.stdout.columns;\n\t\t\t\t},\n\t\t\t\tget rows() {\n\t\t\t\t\treturn process.stdout.rows;\n\t\t\t\t},\n\t\t\t\twrite(text: string): boolean {\n\t\t\t\t\twriteStdout(text);\n\t\t\t\t\treturn true;\n\t\t\t\t},\n\t\t\t} satisfies LiveBoardOutput);\n\tconst print = (text: string): void => {","sourceCodeStart":902,"sourceCodeEnd":938,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/cli/bench-cli.ts#L902-L938","documentation":"The bench command requires at least one model selector as a positional argument (e.g. `omp bench opus gpt-5.2`). With an empty model list there is nothing to benchmark, so the CLI throws before creating the live progress board.","triggerScenarios":"Running `omp bench` with no positional model selectors.","commonSituations":"Forgetting the subcommand arguments entirely; shell variable holding model names expanding to empty; wrapping `omp bench` in a script where args are passed conditionally.","solutions":["Pass at least one model selector: `omp bench opus` or `omp bench opus gpt-5.2`","Verify the variable holding model names is non-empty before invoking the command","Check `omp bench --help` for selector syntax"],"exampleFix":"// before\nomp bench\n// after\nomp bench opus gpt-5.2","handlingStrategy":"validation","validationCode":"const selectors = argv.filter(a => !a.startsWith(\"--\"));\nif (selectors.length === 0) throw new Error(\"omp bench needs at least one model selector, e.g. `omp bench opus`\");","typeGuard":null,"tryCatchPattern":"try {\n  await runBench(argv);\n} catch (err) {\n  if (err instanceof Error && err.message.includes(\"at least one model selector\")) {\n    console.error(\"Usage: omp bench <model-selector>...\");\n    process.exitCode = 2;\n  } else throw err;\n}","preventionTips":["Always pass positional model selectors to `omp bench`","Check shell variables holding model names for emptiness before expansion"],"tags":["cli","missing-argument","validation"],"backgroundTag":"missing-required-argument","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}