{"record":{"id":"05e1d3115cf4d69c","repo":"diegosouzapw/OmniRoute","slug":"provider-returned-no-recognizable-image-payload","errorCode":null,"errorMessage":"Provider returned no recognizable image payload: ${JSON.stringify(payload).slice(0, 240)}","messagePattern":"Provider returned no recognizable image payload: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"open-sse/handlers/imageGeneration.ts","lineNumber":2438,"sourceCode":"    for (const item of payload.images) pushCandidate(item);\n  }\n\n  if (payload?.image) pushCandidate({ b64_json: payload.image });\n  if (payload?.url) pushCandidate({ url: payload.url });\n  if (payload?.sample) pushCandidate({ url: payload.sample });\n  if (payload?.result?.sample) pushCandidate({ url: payload.result.sample });\n  if (Array.isArray(payload?.result?.images)) {\n    for (const item of payload.result.images) pushCandidate(item);\n  }\n\n  const normalized = [];\n  for (const candidate of candidates) {\n    const item = await normalizeProviderImageCandidate(candidate, body, defaultFormat);\n    if (item) normalized.push(item);\n  }\n\n  if (normalized.length === 0 && log) {\n    log.warn(\n      \"IMAGE\",\n      `Provider returned no recognizable image payload: ${JSON.stringify(payload).slice(0, 240)}`\n    );\n  }\n\n  return normalized;\n}\n\nasync function normalizeProviderImageCandidate(candidate, body, defaultFormat) {\n  const wantsBase64 = body?.response_format === \"b64_json\" || defaultFormat === \"b64_json\";\n  let url = null;\n  let b64 = null;\n\n  if (typeof candidate === \"string\") {\n    const dataUriMatch = /^data:[^;]+;base64,(.+)$/i.exec(candidate);\n    if (dataUriMatch) {\n      b64 = dataUriMatch[1];\n    } else if (isHttpUrl(candidate)) {","sourceCodeStart":2420,"sourceCodeEnd":2456,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/open-sse/handlers/imageGeneration.ts#L2420-L2456","documentation":"The provider's image-generation response payload contained no recognizable image data — none of the known shapes (images array, image, url, sample, result.sample, result.images) yielded a usable candidate after normalization. The handler logs a truncated payload dump (240 chars) and fails the image request instead of returning an empty image list.","triggerScenarios":"Thrown at open-sse/handlers/imageGeneration.ts:2438 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the logged payload fragment to identify the provider's actual response shape","Check provider status/credentials — some return error objects with 200","Add the new shape to the candidate extraction if the provider changed its API"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}