jackwener/OpenCLI · error · CliError

EMPTY_RESPONSE

EMPTY_RESPONSE

Error message

EMPTY_RESPONSE

What it means

EMPTY_RESPONSE is thrown by the upscale command when the API response contains neither data.image nor a non-empty data.images[0] — i.e. the request succeeded (no API_ERROR) but no result URL came back. The library treats a missing result URL as an unusable response rather than silently returning nothing.

Source

Thrown at clis/yollomi/upscale.js:33

    strategy: Strategy.COOKIE,
    args: [
        { name: 'image', positional: true, required: true, help: 'Image URL to upscale' },
        { name: 'scale', default: '2', choices: ['2', '4'], help: 'Upscale factor (2 or 4)' },
        { name: 'output', default: './yollomi-output', help: 'Output directory' },
        { name: 'no-download', type: 'boolean', default: false, help: 'Only show URL' },
    ],
    columns: ['status', 'file', 'size', 'scale', 'url'],
    func: async (page, kwargs) => {
        const scale = parseInt(kwargs.scale, 10);
        log.status(`Upscaling ${scale}x...`);
        const data = await yollomiPost(page, '/api/ai/image-upscaler', {
            imageUrl: kwargs.image,
            scale,
            face_enhance: false,
        });
        const url = data.image || (data.images?.[0]);
        if (!url)
            throw new CliError('EMPTY_RESPONSE', 'No result', 'Check the input image');
        if (kwargs['no-download'])
            return [{ status: 'upscaled', file: '-', size: '-', scale: `${scale}x`, url }];
        try {
            const urlPath = (() => { try {
                return new URL(url).pathname;
            }
            catch {
                return url;
            } })();
            const ext = urlPath.endsWith('.png') || urlPath.endsWith('.webp') ? urlPath.slice(urlPath.lastIndexOf('.')) : '.jpg';
            const filename = `yollomi_upscale_${scale}x_${Date.now()}${ext}`;
            const { path: fp, size } = await downloadOutput(url, kwargs.output, filename);
            if (data.remainingCredits !== undefined)
                log.status(`Credits remaining: ${data.remainingCredits}`);
            return [{ status: 'saved', file: path.relative('.', fp), size: fmtBytes(size), scale: `${scale}x`, url }];
        }
        catch {
            return [{ status: 'download-failed', file: '-', size: '-', scale: `${scale}x`, url }];

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Verify the input image URL is valid and publicly reachable (this is what the fix hint points at)
  2. Log or print the raw response (e.g. use --no-download or inspect network tab in the bridged Chrome) to see the actual body shape
  3. Retry — transient backend issues can yield empty payloads
  4. Update the CLI if the yollomi API response schema changed; check for a newer version

Example fix

// before
yollomi upscale --image https://example.com/broken-link.png
// EMPTY_RESPONSE: No result
// after
yollomi upscale --image https://example.com/real-photo.jpg
Defensive patterns

Strategy: type-guard

Validate before calling

// Pre-check that an image URL is reachable before using it as input
const head = await fetch(imageUrl, { method: 'HEAD' });
if (!head.ok) throw new Error(`Input image unreachable: HTTP ${head.status}`);

Type guard

function hasResultUrl(data) {
  return typeof data?.image === 'string' && data.image.length > 0
    || typeof data?.images?.[0] === 'string' && data.images[0].length > 0;
}

Try / catch

try {
  const out = await upscale(page, { image });
} catch (e) {
  if (e.code === 'EMPTY_RESPONSE') console.error('No result URL — verify input image and retry');
  else throw e;
}

Prevention

When it happens

Trigger: Calling the upscale command and yollomiPost returns a parsed body lacking image/images fields — e.g. the API returned an unexpected shape, a partial success, or an empty object.

Common situations: Upgrading model/server versions that changed the response schema, passing a corrupt or unreachable input image that produced no output, or API-side processing silently producing zero results.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/c5410eeeab0f8a5e. Report an issue: GitHub.