{"record":{"id":"c0ba4385f3cfe896","repo":"CherryHQ/cherry-studio","slug":"image-generation-for-sdkconfig-modelid-comple","errorCode":null,"errorMessage":"Image generation for '${sdkConfig.modelId}' completed but returned no image URLs","messagePattern":"Image generation for '(.+?)' completed but returned no image URLs","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/main/ai/provider/custom/tasks/imageGenerationJobHandler.ts","lineNumber":132,"sourceCode":"    if (captureContext) {\n      const completedAt = Date.now()\n      aiUsageRecordService.recordInvocation({\n        requestId: `custom-image:${ctx.jobId}`,\n        context: captureContext,\n        modality: 'image',\n        imageCount: urls.length,\n        metrics: { timeCompletionMs: Math.max(0, completedAt - usageStartedAt) },\n        completedAt\n      })\n    }\n\n    // An empty URL list from a *successful* submit/poll (e.g. content moderation\n    // or a degraded vendor response that still charged) must fail rather than\n    // complete as a silent zero-image \"success\". Covers both submit.imageUrls === []\n    // and poll() === []; the malformed-submit (neither field) case threw above.\n    // Recorded above with imageCount=0 because the provider invocation did complete.\n    if (urls.length === 0) {\n      throw new Error(`Image generation for '${sdkConfig.modelId}' completed but returned no image URLs`)\n    }\n\n    const files = await downloadAndPersistImageUrls(urls, ctx.signal, input.cleanupPolicy)\n    ctx.reportProgress(100, { stage: 'done' })\n    return { files } satisfies ImageGenerationJobOutput\n  }\n}\n\nasync function buildSubmitInput(\n  input: ImageGenerationJobPayload,\n  modelId: string,\n  signal: AbortSignal\n): Promise<ImageGenerationSubmitInput> {\n  const files = input.inputFileIds?.length ? await Promise.all(input.inputFileIds.map(readImageFile)) : undefined\n  const mask = input.maskFileId ? await readImageFile(input.maskFileId) : undefined\n  return {\n    modelId,\n    prompt: input.prompt,","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/CherryHQ/cherry-studio/blob/726446b54cd69ffe51a276638672f6d95ca0768c/src/main/ai/provider/custom/tasks/imageGenerationJobHandler.ts#L114-L150","documentation":"Error \"Image generation for '${sdkConfig.modelId}' completed but returned no image URLs\" thrown in CherryHQ/cherry-studio.","triggerScenarios":"The provider invocation completes successfully but yields an empty image URL list — either submit.imageUrls === [] or poll() resolves with [].","commonSituations":"Typical when content moderation blocks the generation or the vendor returns a degraded success response while still charging. The handler records the invocation with imageCount=0, then fails the job rather than reporting a silent zero-image success.","solutions":["Inspect the raw provider response to see which field carries the generated images and update the transport parser accordingly.","Retry the request; some providers intermittently return empty result sets under load.","Check the provider dashboard for content-filter rejections that yield a success status with no URLs."],"exampleFix":"Map the provider's result field correctly, e.g. imageUrls: data.output.results.map(r => r.url), instead of assuming data.images.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"726446b54cd69ffe51a276638672f6d95ca0768c","analyzedAt":"2026-08-12T17:30:37.448Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}