{"record":{"id":"587c85f097a36f51","repo":"can1357/oh-my-pi","slug":"model-modelselector-not-found","errorCode":null,"errorMessage":"Model \"${modelSelector}\" not found","messagePattern":"Model \"(.+?)\" not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/cli/dry-balance-cli.ts","lineNumber":562,"sourceCode":"\t}\n}\n\nasync function resolveDryBalanceModel(\n\tmodelSelector: string | undefined,\n\tmodelRegistry: DryBalanceModelRegistry,\n\tsettings: Settings | undefined,\n\trandomSessionId: () => string,\n): Promise<{ model: Model<Api>; warning?: string }> {\n\tconst preferences = getModelMatchPreferences(settings);\n\tif (modelSelector) {\n\t\tconst resolved = resolveCliModel({\n\t\t\tcliModel: modelSelector,\n\t\t\tmodelRegistry,\n\t\t\tsettings,\n\t\t\tpreferences,\n\t\t});\n\t\tif (resolved.error) throw new Error(resolved.error);\n\t\tif (!resolved.model) throw new Error(`Model \"${modelSelector}\" not found`);\n\t\treturn { model: resolved.model, warning: resolved.warning };\n\t}\n\n\tconst allowedModels = await resolveAllowedModels(modelRegistry, settings, preferences);\n\tif (allowedModels.length === 0) {\n\t\tthrow new Error(\n\t\t\t\"No models available. Use --model to select a model or configure enabledModels/default model settings.\",\n\t\t);\n\t}\n\n\tconst defaultRoleSpec = resolveModelRoleValue(settings?.getModelRole(\"default\"), allowedModels, {\n\t\tsettings,\n\t\tmatchPreferences: preferences,\n\t});\n\tif (defaultRoleSpec.model) {\n\t\treturn { model: defaultRoleSpec.model, warning: defaultRoleSpec.warning };\n\t}\n","sourceCodeStart":544,"sourceCodeEnd":580,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/cli/dry-balance-cli.ts#L544-L580","documentation":"Thrown when resolveCliModel returns no error but also no model — i.e. the --model selector string was well-formed yet matched nothing in the model registry. dry-balance requires a concrete model to benchmark and reports the exact selector back so you can spot the typo.","triggerScenarios":"`omp dry-balance --model <selector>` where the selector parses but no registry entry matches: wrong provider id, wrong model name, model filtered out by enabledModels settings, or registry not yet populated.","commonSituations":"Case-sensitive id mismatches, using an alias that does not exist, the model being excluded by enabledModels/default-model settings, or a custom provider whose models were never fetched.","solutions":["Copy the exact id from the model list (`omp models`) instead of typing from memory","Check enabledModels / default model settings are not filtering the model out","Verify the provider is configured and authenticated so its models load into the registry","Use the full provider/model form: --model openai/gpt-4.1, not just gpt-4.1"],"exampleFix":"// before\nomp dry-balance --model openai/gpt4-turbo\n// after\nomp dry-balance --model openai/gpt-4-turbo","handlingStrategy":"validation","validationCode":"const ids = await listAvailableModelIds();\nif (!ids.includes(selector)) {\n  throw new Error(`Model \"${selector}\" not found. Available: ${ids.slice(0, 20).join(', ')}...`);\n}","typeGuard":"function isResolvedModel(r: { error?: string | null; model?: unknown }): r is { error?: undefined; model: NonNullable<typeof r.model> } {\n  return !r.error && r.model != null;\n}","tryCatchPattern":"try {\n  const { model } = await resolveDryBalanceModel(opts);\n} catch (e) {\n  if (/not found/.test((e as Error).message)) {\n    console.error(`Selector matched nothing: ${(e as Error).message}. Run the model list command for exact ids.`);\n  } else throw e;\n}","preventionTips":["Check enabledModels settings are not filtering the model out","Watch case sensitivity and exact spelling of provider and model ids","Ensure the provider is configured/authenticated so its models load into the registry"],"tags":["cli","model-resolution","dry-balance","typo"],"backgroundTag":"model-not-found","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}