{"record":{"id":"1b2e6fa116e0dd34","repo":"can1357/oh-my-pi","slug":"imageshack-response-did-not-include-an-image","errorCode":null,"errorMessage":"imageshack response did not include an image","messagePattern":"imageshack response did not include an image","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/blob-broker/uploaders-image-hosts.ts","lineNumber":132,"sourceCode":"\tconst authToken = requireCredential(config, \"authToken\");\n\tconst isPublic = optionBoolean(config, \"public\", false) ?? false;\n\n\treturn {\n\t\tdestination: \"imageshack\",\n\t\tasync upload(request) {\n\t\t\tconst response = await fetchFor(config)(IMAGESHACK_UPLOAD_URL, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: multipartFile(request, \"file\", {\n\t\t\t\t\tapi_key: apiKey,\n\t\t\t\t\tauth_token: authToken,\n\t\t\t\t\tpublic: isPublic ? \"y\" : \"n\",\n\t\t\t\t}),\n\t\t\t});\n\t\t\tconst payload = await jsonResponse(response, \"imageshack\");\n\t\t\tif (payload.success !== true) throw new Error(\"imageshack rejected the upload\");\n\t\t\tconst result = nestedRecord(payload, \"result\", \"imageshack\");\n\t\t\tif (!Array.isArray(result.images) || result.images.length === 0) {\n\t\t\t\tthrow new Error(\"imageshack response did not include an image\");\n\t\t\t}\n\t\t\tconst image = responseRecord(result.images[0], \"imageshack\");\n\t\t\tconst server = image.server;\n\t\t\tconst bucket = image.bucket;\n\t\t\tconst filename = image.filename;\n\t\t\tif (\n\t\t\t\t(typeof server !== \"string\" && typeof server !== \"number\") ||\n\t\t\t\t(typeof bucket !== \"string\" && typeof bucket !== \"number\") ||\n\t\t\t\ttypeof filename !== \"string\" ||\n\t\t\t\t!filename\n\t\t\t) {\n\t\t\t\tthrow new Error(\"imageshack response did not include direct image coordinates\");\n\t\t\t}\n\t\t\tconst url = directUrl(`https://imagizer.imageshack.com/a/img${server}/${bucket}/${filename}`, \"imageshack\");\n\t\t\treturn publication(\"imageshack\", request, url, {\n\t\t\t\tremoteId: typeof image.id === \"string\" ? image.id : undefined,\n\t\t\t});\n\t\t},","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/blob-broker/uploaders-image-hosts.ts#L114-L150","documentation":"After success:true, the ImageShack uploader expects payload.result.images to be a non-empty array. If `result` has no `images` array or it is empty, this error is thrown. It detects responses where the upload nominally succeeded but no image entry was produced.","triggerScenarios":"payload.result.images is missing, not an array, or an empty array — e.g. ImageShack accepted the request but stripped the image (content filter) or the API shape changed.","commonSituations":"ImageShack removing uploads by content policy while still returning success; API version drift renaming/nesting `images`; mocked responses lacking the array.","solutions":["Log the entire payload to inspect result and result.images","Confirm you are hitting the current ImageShack upload API version","Check whether the image was removed by content moderation despite success:true","Fall back to another image host when the array is empty"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const payload = await response.json();\nif (payload?.success !== true || !Array.isArray(payload?.result?.images) || payload.result.images.length === 0) {\n  throw new Error(\"imageshack response lacks images array: \" + JSON.stringify(payload));\n}","typeGuard":"function hasImagesArray(payload) {\n  return typeof payload?.result?.images === \"object\" && Array.isArray(payload.result.images) && payload.result.images.length > 0;\n}","tryCatchPattern":"try {\n  const pub = await broker.publish(request);\n} catch (err) {\n  if (err.message === \"imageshack response did not include an image\") {\n    logger.warn(\"imageshack success without image entry\", { payload });\n    return fallbackUploader.publish(request);\n  }\n  throw err;\n}","preventionTips":["Log the full payload to detect success:true responses with stripped images","Stay current with ImageShack API schema changes","Be aware content moderation can remove images while reporting success","Always configure a fallback destination"],"tags":["schema-mismatch","imageshack","missing-field","upload"],"backgroundTag":"schema-validation-failed","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}