{"record":{"id":"a81bb379a2b197f1","repo":"nexu-io/open-design","slug":"vela-model-wiremodel-does-not-publish-aspect","errorCode":null,"errorMessage":"Vela model ${wireModel} does not publish aspect ${aspect}; supported: ${supported.join(', ')}","messagePattern":"Vela model (.+?) does not publish aspect (.+?); supported: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/daemon/src/media/vela.ts","lineNumber":295,"sourceCode":" * pricing decision: the model's own default tier is the only choice that keeps\n * an unqualified request costing what an unqualified request costs.\n */\nfunction selectImageOutputProfile(\n  published: VelaPublishedImageCapabilities | null,\n  aspect: string | undefined,\n  requestedResolution: string | undefined,\n  wireModel: string,\n): VelaImageOutputProfile | undefined {\n  if (!aspect) return undefined;\n  if (!published || published.profiles.length === 0) {\n    throw new Error(\n      `Vela model ${wireModel} does not publish output profiles, so aspect ${aspect} cannot be requested`,\n    );\n  }\n  const matching = published.profiles.filter((profile) => profile.aspectRatio === aspect);\n  if (matching.length === 0) {\n    const supported = [...new Set(published.profiles.map((profile) => profile.aspectRatio))];\n    throw new Error(\n      `Vela model ${wireModel} does not publish aspect ${aspect}; supported: ${supported.join(', ')}`,\n    );\n  }\n  if (requestedResolution) {\n    const supported = matching.map((profile) => profile.resolution);\n    const publishedResolution = matchPublishedValue(requestedResolution, supported);\n    const exact = matching.find((profile) => profile.resolution === publishedResolution);\n    if (!exact) {\n      throw new Error(\n        `Vela model ${wireModel} does not publish resolution ${requestedResolution} at aspect ${aspect}; supported: ${supported.join(', ')}`,\n      );\n    }\n    return exact;\n  }\n  // Several resolutions can share one aspect ratio. Prefer the one the model\n  // defaults to, so asking only for a shape does not silently change quality\n  // tier or price relative to an unqualified request.\n  const preferred = matching.find((profile) => profile.resolution === published.defaultResolution);","sourceCodeStart":277,"sourceCodeEnd":313,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/media/vela.ts#L277-L313","documentation":"Thrown by selectImageOutputProfile() when the model publishes profiles but none has an aspectRatio matching the requested aspect. The supported aspect ratios are listed in the error (deduplicated). Vela's CLI requires a matching (aspect, resolution) pair, so an unsupported aspect cannot be sent.","triggerScenarios":"input.aspect is a string (e.g. '4:3') that does not match any profile.aspectRatio in the model's published profiles for the request kind.","commonSituations":"Model only publishes 16:9 / 9:16 / 1:1 but caller asked for 4:3 or 3:4; aspect typo; catalogue changed the supported aspects.","solutions":["Use one of the aspect ratios listed in the error message","Check `vela media models --json` for the model's current supported aspects","Switch to a model that publishes the desired aspect"],"exampleFix":"// before\nawait renderVelaImage({ ...input, aspect: '4:3' }); // not published\n// after\nawait renderVelaImage({ ...input, aspect: '16:9' });","handlingStrategy":"validation","validationCode":"function aspectIsPublished(aspect: string, published: VelaPublishedImageCapabilities): boolean {\n  return published.profiles.some(p => p.aspectRatio === aspect);\n}\n\nconst supportedAspects = new Set(published.profiles.map(p => p.aspectRatio));\nif (aspect && !supportedAspects.has(aspect)) {\n  // pick a supported aspect or drop it\n}","typeGuard":null,"tryCatchPattern":"try {\n  const profile = selectImageOutputProfile(published, aspect, resolution, wireModel);\n} catch (err) {\n  if (err instanceof Error && /does not publish aspect/.test(err.message)) {\n    // parse supported aspects from the message and retry with one\n  } else throw err;\n}","preventionTips":["Offer only published aspect ratios in the UI picker","Re-fetch the catalogue when the model changes within a session","Treat the catalogue's aspect list as authoritative over any hardcoded UI list"],"tags":["vela","aspect-ratio","capabilities","validation"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}