{"record":{"id":"9f7773ffcd7ff0a4","repo":"can1357/oh-my-pi","slug":"could-not-resolve-errors-length-1-model","errorCode":null,"errorMessage":"Could not resolve ${errors.length === 1 ? \"model\" : \"models\"}:\\n${errors.join(\"\\n\")}","messagePattern":"Could not resolve (.+?):\\\\n(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/cli/bench-runtime.ts","lineNumber":183,"sourceCode":"\t\t\tmodelRegistry,\n\t\t\tpreferences.providerOrder,\n\t\t);\n\t\tif (authenticated) {\n\t\t\twriteStderr(\n\t\t\t\t`${chalk.yellow(\n\t\t\t\t\t`Warning: no credentials for \"${model.provider}\"; benchmarking ${formatModelString(authenticated)} instead. Pin \"${formatModelString(model)}\" to force it.`,\n\t\t\t\t)}\\n`,\n\t\t\t);\n\t\t\tmodel = authenticated;\n\t\t}\n\t\tresolved.push({\n\t\t\tselector,\n\t\t\tmodel,\n\t\t\tthinking: resolveThinkingLevelForModel(model, concreteThinkingLevel(result.thinkingLevel)),\n\t\t});\n\t}\n\tif (errors.length > 0) {\n\t\tthrow new Error(`Could not resolve ${errors.length === 1 ? \"model\" : \"models\"}:\\n${errors.join(\"\\n\")}`);\n\t}\n\treturn resolved;\n}\n","sourceCodeStart":165,"sourceCodeEnd":187,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/cli/bench-runtime.ts#L165-L187","documentation":"resolveBenchTargets maps user model selectors to concrete models plus thinking levels. Any selector that fails to resolve is collected into an errors list; if any failed, it throws a single aggregated Error listing all unresolved selectors, so users see every problem at once instead of one at a time.","triggerScenarios":"Calling resolveBenchTargets (or running `omp bench`) with one or more selectors that match no known model — misspelled aliases, model names not in the catalog, or provider-specific ids that discovery cannot see.","commonSituations":"Typos in model short-names (e.g. `opus-4-6` when alias differs); referencing a newly released model before the catalog is updated; offline/failed provider discovery leaving the model unknown; using an alias removed in a newer version.","solutions":["Fix the selector spelling shown in the error detail lines (one error line per failed selector)","Run `omp models` (or list available models) to see valid selectors","Update the package/catalog so newly released models are known","Remove or replace selectors for models unavailable in your environment/auth"],"exampleFix":"// before\nawait resolveBenchTargets([\"gpt5-turbo\"])\n// after\nawait resolveBenchTargets([\"gpt-5.2\"]) // corrected selector","handlingStrategy":"try-catch","validationCode":"import { resolveModel } from \"@oh-my-pi/pi-catalog\"; // pre-check each selector resolves before benching\nfor (const s of selectors) {\n  if (resolveModel(s) === undefined) console.warn(`Selector \"${s}\" may not resolve`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  const targets = await resolveBenchTargets(selectors);\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith(\"Could not resolve\")) {\n    for (const line of err.message.split(\"\\n\").slice(1)) console.error(`- ${line}`);\n    process.exitCode = 2;\n  } else throw err;\n}","preventionTips":["List available model selectors first (`omp models`) before benching","Keep the catalog/package updated so new models resolve","Quote selectors to avoid shell word-splitting mangling names"],"tags":["model-resolution","cli","invalid-argument"],"backgroundTag":"model-not-found","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}