{"record":{"id":"167b730b7d4740c6","repo":"can1357/oh-my-pi","slug":"resolved-error-model-resolution-failure","errorCode":null,"errorMessage":"resolved.error (model resolution failure)","messagePattern":"resolved\\.error \\(model resolution failure\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/cli/dry-balance-cli.ts","lineNumber":561,"sourceCode":"\t\tthrow error;\n\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}","sourceCodeStart":543,"sourceCodeEnd":579,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/cli/dry-balance-cli.ts#L543-L579","documentation":"resolveDryBalanceModel rethrows the error string produced by resolveCliModel when explicit model resolution (--model selector, settings, preferences) fails. This is the upstream model-resolution failure (bad provider, unresolvable specifier, registry error) surfaced verbatim by dry-balance. The message text is whatever resolveCliModel produced.","triggerScenarios":"Running dry-balance with a --model selector that resolveCliModel cannot resolve: unknown provider prefix, malformed model spec, or a registry/settings error returned in resolved.error.","commonSituations":"Typos in the model id (`--model groq/llama-3.3-7b-typo`), referencing a provider that is not configured/authenticated, or a stale models.json where the requested model no longer exists after an upgrade.","solutions":["Read the interpolated message for the underlying resolution cause and fix that first","Run `omp models` (or list registry entries) to find a valid model id","Re-check --model syntax: it is typically provider/model-id","Update the CLI / model catalog if the model was renamed or removed in a newer version"],"exampleFix":"// before\nomp dry-balance --model groq/llama-3.3-70b-typo\n// after\nomp dry-balance --model groq/llama-3.3-70b-versatile","handlingStrategy":"try-catch","validationCode":"const ids = await listAvailableModelIds(); // from the model registry / omp models\nif (!ids.includes(requestedSelector)) console.warn(`Unknown model selector: ${requestedSelector}`);","typeGuard":"function hasResolutionError(r: { error?: string | null; model?: unknown }): r is { error: string; model?: undefined } {\n  return typeof r.error === 'string' && r.error.length > 0;\n}","tryCatchPattern":"try {\n  const { model } = await resolveDryBalanceModel(opts);\n} catch (e) {\n  console.error(`Model resolution failed: ${(e as Error).message}. Check --model syntax and the model list.`);\n  process.exitCode = 1;\n}","preventionTips":["Copy model ids from the registry listing rather than typing from memory","Use the full provider/model-id form for selectors","Keep the CLI/model catalog updated so ids stay valid"],"tags":["cli","model-resolution","dry-balance","configuration"],"backgroundTag":"model-resolution-failed","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}