{"record":{"id":"deb8272550462341","repo":"nexu-io/open-design","slug":"unknown-model-model-pass-model-from-the-reg","errorCode":null,"errorMessage":"unknown model: ${model}. Pass --model from the registered list (see /api/media/models), or pass a full fal-ai/* path (e.g. fal-ai/flux/dev) for any Fal model.","messagePattern":"unknown model: (.+?)\\. Pass --model from the registered list \\(see /api/media/models\\), or pass a full fal-ai/\\* path \\(e\\.g\\. fal-ai/flux/dev\\) for any Fal model\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/daemon/src/media/index.ts","lineNumber":417,"sourceCode":"      // endpoint, so synthesize a def on the fly — aihubmixWireModel() strips\n      // the `aihubmix-` prefix to the real wire name inside the renderer.\n      isCatalogBypass = true;\n      def = {\n        id: model,\n        label: model,\n        hint: 'AIHubMix',\n        provider: 'aihubmix',\n        caps:\n          surface === 'image'\n            ? ['t2i', 'i2i']\n            : surface === 'video'\n              ? ['t2v', 'i2v']\n              : surface === 'audio'\n                ? ['tts']\n                : [],\n      };\n    } else {\n      throw new Error(\n        `unknown model: ${model}. Pass --model from the registered list (see /api/media/models), ` +\n        `or pass a full fal-ai/* path (e.g. fal-ai/flux/dev) for any Fal model.`,\n      );\n    }\n  }\n  // Reject cross-surface combinations for catalogued models.\n  const resolvedAudioKind =\n    surface === 'audio' ? audioKind || 'music' : undefined;\n  if (!isFalCustomPath && !isCatalogBypass) {\n    const allowed = modelsForSurface(surface, resolvedAudioKind);\n    if (!allowed.some((m) => m.id === def.id)) {\n      const ids = allowed.map((m) => m.id).join(', ');\n      const where =\n        surface === 'audio' ? `audio · ${resolvedAudioKind}` : surface;\n      throw new Error(\n        `model \"${model}\" is not registered for surface \"${where}\". Allowed: ${ids}.`,\n      );\n    }","sourceCodeStart":399,"sourceCodeEnd":435,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/media/index.ts#L399-L435","documentation":"Thrown during model resolution when findMediaModel(model) returns nothing AND the model id matches neither the /^fal-ai\\// bypass nor the /^aihubmix-/ bypass. The dispatcher only knows three routes into a renderer: catalogued id, fal-ai/* arbitrary path, or aihubmix-* dynamic id. Anything else is rejected before any provider call.","triggerScenarios":"Passing --model with a typo, a deprecated id, a provider-namespaced id from another tool (e.g. 'openai/dall-e-3'), or a bare name like 'flux' instead of the full 'fal-ai/flux/dev'. Also hit when a custom-aliased id was expected but no alias is configured.","commonSituations":"User copies a model name from a different UI; an agent hallucinates a model id from training data; catalog was updated and an old id was removed; user expects any string to work because 'fal supports everything'.","solutions":["List registered ids via GET /api/media/models (or od media models --json) and re-run with a valid id.","If the target is a Fal model not yet in the catalog, pass the full path as --model fal-ai/<name> (e.g. fal-ai/flux/dev).","If the target is an AIHubMix model discovered live, prefix the wire name with aihubmix-.","Check media-config.json / OD_MEDIA_MODEL_ALIASES if you expected an alias to resolve the id."],"exampleFix":"// before\nod media generate --surface image --model flux --prompt \"...\"\n// after\nod media generate --surface image --model fal-ai/flux/dev --prompt \"...\"","handlingStrategy":"validation","validationCode":"async function resolveModelId(requested: string): Promise<string> {\n  const known = await fetchRegisteredModelIds(); // GET /api/media/models\n  if (known.includes(requested)) return requested;\n  if (/^fal-ai\\//.test(requested) || /^aihubmix-/.test(requested)) return requested;\n  throw new Error(`unknown model: ${requested}. Use an id from /api/media/models or a fal-ai/* path.`);\n}","typeGuard":"function isCatalogOrBypassModel(model: string, registeredIds: string[]): boolean {\n  return registeredIds.includes(model) || /^fal-ai\\//.test(model) || /^aihubmix-/.test(model);\n}","tryCatchPattern":null,"preventionTips":["Always list models via /api/media/models before prompting the user or agent to pick one.","When targeting Fal, use the full fal-ai/<name> form so the bypass applies even if the catalog lags.","Validate model ids in the agent tool schema against the live catalog."],"tags":["validation","media","model-resolution","catalog"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}