{"record":{"id":"e8fb7502c50a3e68","repo":"can1357/oh-my-pi","slug":"imageshack-response-did-not-include-direct-image-c","errorCode":null,"errorMessage":"imageshack response did not include direct image coordinates","messagePattern":"imageshack response did not include direct image coordinates","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/blob-broker/uploaders-image-hosts.ts","lineNumber":144,"sourceCode":"\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},\n\t};\n}\n\nfunction oauthEncode(value: string): string {\n\treturn encodeURIComponent(value).replace(\n\t\t/[!'()*]/g,\n\t\tcharacter => `%${character.charCodeAt(0).toString(16).toUpperCase()}`,\n\t);\n}\n\nfunction oauthBaseUrl(value: string): string {\n\tconst url = new URL(value);","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/blob-broker/uploaders-image-hosts.ts#L126-L162","documentation":"To build the direct image URL, ImageShack returns server, bucket, and filename coordinates. The uploader requires server and bucket to be string or number, and filename to be a non-empty string; otherwise it throws this error. Without these three parts the imagizer.imageshack.com direct link cannot be assembled.","triggerScenarios":"The first image in result.images lacks server, bucket, or a non-empty filename — host omitted fields, types changed (e.g. server as object), or filename is empty.","commonSituations":"ImageShack API schema drift on the image object; partial moderation responses; test mocks with incomplete image records.","solutions":["Log the full image object to see which coordinate is missing or wrongly typed","Update field mapping if ImageShack renamed or restructured server/bucket/filename","Verify the image was not quarantined (moderation) which omits direct coordinates","Fall back to another image host or use an alternative URL field if the host provides one"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"const img = payload.result.images[0];\nconst coordsOk = (typeof img?.server === \"string\" || typeof img?.server === \"number\")\n  && (typeof img?.bucket === \"string\" || typeof img?.bucket === \"number\")\n  && typeof img?.filename === \"string\" && img.filename.length > 0;\nif (!coordsOk) throw new Error(\"imageshack image missing server/bucket/filename\");","typeGuard":"function hasDirectCoordinates(image) {\n  return (typeof image?.server === \"string\" || typeof image?.server === \"number\")\n    && (typeof image?.bucket === \"string\" || typeof image?.bucket === \"number\")\n    && typeof image?.filename === \"string\" && image.filename.length > 0;\n}","tryCatchPattern":"try {\n  const pub = await broker.publish(request);\n} catch (err) {\n  if (err.message === \"imageshack response did not include direct image coordinates\") {\n    logger.warn(\"imageshack image object incomplete\", { image });\n    return fallbackUploader.publish(request);\n  }\n  throw err;\n}","preventionTips":["Log the image object when coordinates are missing to spot schema drift","Check for quarantined/moderated uploads that omit direct-link fields","Pin and test against the current ImageShack API version","Use a fallback host instead of failing the whole publish"],"tags":["schema-mismatch","imageshack","missing-field","url-construction"],"backgroundTag":"schema-validation-failed","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}