{"record":{"id":"0c4b58f688730a45","repo":"nexu-io/open-design","slug":"vela-model-wiremodel-does-not-publish-a-quality","errorCode":null,"errorMessage":"Vela model ${wireModel} does not publish a quality capability, so quality ${tier} cannot be requested","messagePattern":"Vela model (.+?) does not publish a quality capability, so quality (.+?) cannot be requested","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/daemon/src/media/vela.ts","lineNumber":241,"sourceCode":"\n/**\n * Turn a requested tier into the `--quality` argument, or into nothing.\n *\n * Three outcomes, and the difference matters for billing: an unqualified\n * request sends no flag and is priced at the model's own default tier; a\n * request for a tier the model publishes sends it verbatim; a request the\n * model cannot honour fails here, before it costs anything, with the tiers it\n * does publish.\n */\nfunction qualityArgs(\n  requested: string | undefined,\n  published: VelaPublishedImageCapabilities,\n  wireModel: string,\n): string[] {\n  const tier = requested?.trim();\n  if (!tier) return [];\n  if (!published.qualityValues) {\n    throw new Error(\n      `Vela model ${wireModel} does not publish a quality capability, so quality ${tier} cannot be requested`,\n    );\n  }\n  const publishedTier = matchPublishedValue(tier, published.qualityValues);\n  if (!publishedTier) {\n    throw new Error(\n      `Vela model ${wireModel} does not publish quality ${tier}; supported: ${published.qualityValues.join(', ')}`,\n    );\n  }\n  return ['--quality', publishedTier];\n}\n\n// Vela owns which shapes and tiers a model can actually deliver, so read the\n// published capabilities per request instead of caching a copy here: a\n// catalogue that gained or lost one must take effect immediately, and one\n// extra CLI call is nothing beside the generation it precedes.\nasync function fetchPublishedImageCapabilities(\n  input: VelaImageRenderInput,","sourceCodeStart":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/media/vela.ts#L223-L259","documentation":"Thrown by qualityArgs() when the caller requested a quality tier but the model's published capabilities have qualityValues === null — meaning the model publishes no quality capability at all. Only some models are tiered (the comment names gpt-image-2 as an example); asking an untiered model for a tier is rejected before the CLI call to avoid a guaranteed server-side failure.","triggerScenarios":"Calling renderVelaImage with input.quality set, where the model was found in the catalogue (published is non-null) but its capabilities.quality object is absent, so qualityValues resolved to null.","commonSituations":"Caller assumed a model supports quality tiers when it does not; model was downgraded/changed and lost its tier capability; quality was hardcoded for a tiered model but applied to an untiered one.","solutions":["Omit input.quality for models that do not publish tiers (let the server default apply)","Verify the model actually publishes a quality capability via `vela media models --json`","Pick a tiered model if a specific quality tier is required"],"exampleFix":"// before\nawait renderVelaImage({ ...input, model: 'vela/untiered-model', quality: 'high' });\n// after\nawait renderVelaImage({ ...input, model: 'vela/untiered-model' }); // no quality","handlingStrategy":"validation","validationCode":"function modelPublishesQuality(published: VelaPublishedImageCapabilities | null): boolean {\n  return published?.qualityValues != null && published.qualityValues.length >= 0;\n}\n\nif (requestedQuality && !modelPublishesQuality(published)) {\n  // drop quality and proceed with the server default\n}","typeGuard":"function publishesQuality(p: { qualityValues: string[] | null }): p is { qualityValues: string[] } {\n  return Array.isArray(p.qualityValues);\n}","tryCatchPattern":"try {\n  const args = qualityArgs(requestedQuality, published, wireModel);\n} catch (err) {\n  if (err instanceof Error && /does not publish a quality capability/.test(err.message)) {\n    // retry without quality\n  } else throw err;\n}","preventionTips":["Only set input.quality for models known to publish a quality capability","Read `vela media models --json` once per session to learn which models are tiered","Default input.quality to undefined so untiered models use the server default"],"tags":["vela","quality","capabilities","validation"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}