{"record":{"id":"79668a1f4b4fbd3c","repo":"jackwener/OpenCLI","slug":"empty-response-79668a","errorCode":"EMPTY_RESPONSE","errorMessage":"EMPTY_RESPONSE","messagePattern":"EMPTY_RESPONSE","errorType":"error_code","errorClass":"CliError","httpStatus":null,"severity":"error","filePath":"clis/yollomi/object-remover.js","lineNumber":31,"sourceCode":"    description: 'Remove unwanted objects from images (3 credits)',\n    domain: YOLLOMI_DOMAIN,\n    strategy: Strategy.COOKIE,\n    args: [\n        { name: 'image', positional: true, required: true, help: 'Image URL' },\n        { name: 'mask', positional: true, required: true, help: 'Mask image URL (white = area to remove)' },\n        { name: 'output', default: './yollomi-output', help: 'Output directory' },\n        { name: 'no-download', type: 'boolean', default: false, help: 'Only show URL' },\n    ],\n    columns: ['status', 'file', 'size', 'url'],\n    func: async (page, kwargs) => {\n        log.status('Removing object...');\n        const data = await yollomiPost(page, '/api/ai/object-remover', {\n            image: kwargs.image,\n            mask: kwargs.mask,\n        });\n        const url = data.image || (data.images?.[0]);\n        if (!url)\n            throw new CliError('EMPTY_RESPONSE', 'No result', 'Check image and mask');\n        if (kwargs['no-download'])\n            return [{ status: 'removed', file: '-', size: '-', url }];\n        try {\n            const filename = `yollomi_removed_${Date.now()}.png`;\n            const { path: fp, size } = await downloadOutput(url, kwargs.output, filename);\n            return [{ status: 'saved', file: path.relative('.', fp), size: fmtBytes(size), url }];\n        }\n        catch {\n            return [{ status: 'download-failed', file: '-', size: '-', url }];\n        }\n    },\n});\n","sourceCodeStart":13,"sourceCodeEnd":44,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/yollomi/object-remover.js#L13-L44","documentation":"The yollomi object-remover command throws EMPTY_RESPONSE when /api/ai/object-remover returns no result image. It reads data.image or data.images[0]; if both are missing, no removal output was produced and the CLI aborts before download.","triggerScenarios":"POSTing { image: kwargs.image, mask: kwargs.mask } yields a 200 with no image fields — commonly a mask/image mismatch (different dimensions), an unfetchable URL, or a changed response schema.","commonSituations":"Mask dimensions not matching the input image; mask format not accepted by the endpoint; input image URL private or expired; silent server-side failure with empty payload.","solutions":["Verify the mask matches the input image dimensions and format (per the hint)","Ensure both image and mask are publicly accessible valid files","Retry — transient failures may return empty responses","Log the raw API response to check for ignored error fields","Update field extraction if the site API response changed"],"exampleFix":"// before\nconst url = data.image || (data.images?.[0]);\nif (!url) throw new CliError('EMPTY_RESPONSE', 'No result', 'Check image and mask');\n// after\nif (data.error) throw new CliError('API_ERROR', data.error, 'Check object-remover API response');\nconst url = data.image || data.result || (data.images?.[0]);\nif (!url) throw new CliError('EMPTY_RESPONSE', 'No result', 'Check image and mask');","handlingStrategy":"validation","validationCode":"const imgMeta = await probe(kwargs.image), maskMeta = await probe(kwargs.mask);\nif (imgMeta.width !== maskMeta.width || imgMeta.height !== maskMeta.height)\n  throw new Error(`mask ${maskMeta.width}x${maskMeta.height} does not match image ${imgMeta.width}x${imgMeta.height}`);","typeGuard":"function hasRemovalResult(d) {\n  return d != null && (typeof d.image === 'string' || (Array.isArray(d.images) && typeof d.images[0] === 'string'));\n}","tryCatchPattern":"try {\n  const rows = await opencli.yollomi['object-remover']({ image, mask });\n} catch (e) {\n  if (e.code === 'EMPTY_RESPONSE') {\n    console.error(`${e.message}: ${e.hint} — verify mask dimensions match the image`);\n  } else throw e;\n}","preventionTips":["Ensure the mask is the exact same dimensions as the input image","Use a supported binary mask format","HEAD-check both image and mask URLs first","Retry once before surfacing the failure"],"tags":["empty-response","api","cli","inpainting"],"backgroundTag":"empty-api-response","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}