{"record":{"id":"d633266a63aaac45","repo":"can1357/oh-my-pi","slug":"no-models-available-use-model-to-select-a-model","errorCode":null,"errorMessage":"No models available. Use --model to select a model or configure enabledModels/default model settings.","messagePattern":"No models available\\. Use --model to select a model or configure enabledModels/default model settings\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/cli/dry-balance-cli.ts","lineNumber":568,"sourceCode":"\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\n\tfor (const candidate of allowedModels) {\n\t\tconst apiKey = await modelRegistry.getApiKey(candidate, randomSessionId());\n\t\tif (apiKey) return { model: candidate };\n\t}\n\n\treturn {","sourceCodeStart":550,"sourceCodeEnd":586,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/cli/dry-balance-cli.ts#L550-L586","documentation":"When no --model selector is given, dry-balance falls back to the allowed-models list (enabledModels/default model settings). If that list is empty there is nothing to benchmark, so the command aborts with this guidance message instead of guessing a model.","triggerScenarios":"Running `omp dry-balance` (no --model) when resolveAllowedModels returns zero entries — no models configured in settings, enabledModels empty or excluding everything, and no default model role resolvable.","commonSituations":"Fresh installs with no configured providers, users who set enabledModels to an empty list or ids that no longer exist, or environments where the model registry failed to load any providers.","solutions":["Pass an explicit model: omp dry-balance --model <provider/model-id>","Configure enabledModels in settings with at least one available model id","Set a default model (default model role) in settings or preferences","Verify providers are authenticated so their models appear in the registry"],"exampleFix":"// before\nomp dry-balance                       # no models configured\n// after\nomp dry-balance --model groq/llama-3.3-70b-versatile","handlingStrategy":"try-catch","validationCode":"const allowed = await resolveAllowedModels(registry, settings, preferences);\nif (allowed.length === 0) {\n  console.error('No models available: configure enabledModels/default model or pass --model.');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runDryBalance(argv);\n} catch (e) {\n  if (/No models available/.test((e as Error).message)) {\n    console.error('Configure a default model / enabledModels in settings, or pass --model <provider/model>.');\n  } else throw e;\n}","preventionTips":["On fresh installs, set a default model before running dry-balance","Keep enabledModels non-empty and pointing at ids that still exist","Prefer passing --model explicitly in scripts to avoid depending on ambient settings"],"tags":["cli","configuration","dry-balance","model-resolution"],"backgroundTag":"no-models-configured","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}