{"record":{"id":"fc31f4cb49511230","repo":"CherryHQ/cherry-studio","slug":"unsupported-dashscope-image-model-descriptor-id","errorCode":null,"errorMessage":"Unsupported DashScope image model: ${descriptor.id}","messagePattern":"Unsupported DashScope image model: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/main/ai/provider/custom/dashscope/dashscopeTransport.ts","lineNumber":364,"sourceCode":"    case 'wan2.7-image':\n    case 'wan2.7-image-pro':\n      return buildChatLikeBody(input, bag)\n    case 'qwen-image':\n    case 'qwen-image-plus':\n    case 'wanx2.1-t2i-turbo':\n    case 'wanx2.1-t2i-plus':\n    case 'wanx2.0-t2i-turbo':\n      return buildText2ImageBody(input, bag)\n    case 'wanx-v1':\n      return buildWanxV1Body(input, bag)\n    case 'wan2.5-i2i-preview':\n      return buildWan25I2IBody(input, bag)\n    case 'qwen-mt-image':\n      return buildQwenMtImageBody(input, bag)\n    case 'wanx2.1-imageedit':\n      return buildWanxImageEditBody(input, bag)\n    default:\n      throw new Error(`Unsupported DashScope image model: ${descriptor.id}`)\n  }\n}\n\nclass DashScopeTransport implements ImageGenerationTransport {\n  private apiKey: string\n  private baseURL: string\n  private pendingDescriptors = new Map<string, DashScopeModelDescriptor>()\n\n  constructor(settings: DashScopeTransportSettings) {\n    this.apiKey = settings.apiKey\n    this.baseURL = settings.imageBaseURL || DEFAULT_DASHSCOPE_IMAGE_BASE_URL\n  }\n\n  async submit(input: ImageGenerationSubmitInput): Promise<{ taskId?: string; imageUrls?: string[] }> {\n    const descriptor = input.modelDescriptor\n    if (!descriptor) {\n      throw new Error(`Missing modelDescriptor for DashScope model: ${input.modelId}`)\n    }","sourceCodeStart":346,"sourceCodeEnd":382,"githubUrl":"https://github.com/CherryHQ/cherry-studio/blob/726446b54cd69ffe51a276638672f6d95ca0768c/src/main/ai/provider/custom/dashscope/dashscopeTransport.ts#L346-L382","documentation":"Thrown by `buildRequestBody` in the DashScope transport when a model descriptor's `id` matches none of the hardcoded `case` branches. The transport dispatches the request body shape per model id (text2image, chat-like, wanx-v1, i2i, mt-image, imageedit); an unknown id means the transport has no body builder for it and cannot form a valid request.","triggerScenarios":"A DashScope image model whose registry id is not listed in the switch (e.g. a newly released model not yet added, or a mistyped/renamed id). The descriptor is injected from the registry's `vendorTransport`, so the registry id and the switch must stay in sync.","commonSituations":"DashScope shipped a new image model and the registry was updated but the transport switch was not; a custom/aliased model id diverges from the canonical wire id; a test used a placeholder id.","solutions":["Add the model id to the matching `case` branch in `buildRequestBody` (dashscopeTransport.ts) using the correct body builder.","Confirm the registry's `vendorTransport` carries the canonical wire id — aliases should map to it before reaching the transport.","If the model is genuinely unsupported, prevent it from being routed to the DashScope transport upstream."],"exampleFix":"// before (model 'wanx3.0-t2i' hits default and throws)\n// after — add to the text2image family\ncase 'wanx2.1-t2i-turbo':\ncase 'wanx2.1-t2i-plus':\ncase 'wanx2.0-t2i-turbo':\ncase 'wanx3.0-t2i':\n  return buildText2ImageBody(input, bag)","handlingStrategy":"validation","validationCode":"const SUPPORTED_DASHSCOPE_IMAGE_MODELS = new Set([\n  'z-image-turbo', 'qwen-image-edit', 'qwen-image-edit-plus',\n  'wan2.6-image', 'wan2.7-image', 'wan2.7-image-pro',\n  'qwen-image', 'qwen-image-plus',\n  'wanx2.1-t2i-turbo', 'wanx2.1-t2i-plus', 'wanx2.0-t2i-turbo',\n  'wanx-v1', 'wan2.5-i2i-preview', 'qwen-mt-image', 'wanx2.1-imageedit'\n])\nif (!SUPPORTED_DASHSCOPE_IMAGE_MODELS.has(descriptor.id)) {\n  throw new Error(`Model ${descriptor.id} has no DashScope body builder — add it to the registry and the transport switch`)\n}","typeGuard":"const isSupportedDashScopeImageModel = (id: string): boolean =>\n  SUPPORTED_DASHSCOPE_IMAGE_MODELS.has(id)","tryCatchPattern":null,"preventionTips":["Keep the transport switch and the registry model list in sync (one source of truth)","Add a test enumerating registry image models against the switch","Route unsupported models away from the DashScope transport in the pipeline"],"tags":["model-routing","dashscope","image-generation","switch-dispatch"],"backgroundTag":null,"analyzedSha":"726446b54cd69ffe51a276638672f6d95ca0768c","analyzedAt":"2026-08-12T17:30:37.448Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}