jackwener/OpenCLI · error · CliError

EMPTY_RESPONSE

EMPTY_RESPONSE

Error message

EMPTY_RESPONSE

What it means

EMPTY_RESPONSE is thrown by the video generation command when the API response has no data.video URL — the request completed without API_ERROR but no video came back. Since video generation is slow and credits may be consumed, the library surfaces this instead of returning an empty result.

Source

Thrown at clis/yollomi/video.js:39

        { name: 'ratio', default: '16:9', choices: ['1:1', '16:9', '9:16', '4:3', '3:4'], help: 'Aspect ratio' },
        { name: 'output', default: './yollomi-output', help: 'Output directory' },
        { name: 'no-download', type: 'boolean', default: false, help: 'Only show URL, skip download' },
    ],
    columns: ['status', 'file', 'size', 'credits', 'url'],
    func: async (page, kwargs) => {
        const prompt = kwargs.prompt;
        const modelId = kwargs.model;
        const inputs = {
            aspect_ratio: kwargs.ratio,
        };
        if (kwargs.image)
            inputs.image = kwargs.image;
        const body = { modelId, prompt, inputs };
        log.status(`Generating video with ${modelId} (may take a while)...`);
        const data = await yollomiPost(page, '/api/ai/video', body);
        const videoUrl = data.video || '';
        if (!videoUrl)
            throw new CliError('EMPTY_RESPONSE', 'No video returned', 'Try a different prompt or model');
        const credits = data.remainingCredits;
        const noDownload = kwargs['no-download'];
        const outputDir = kwargs.output;
        if (noDownload) {
            return [{ status: 'generated', file: '-', size: '-', credits: credits ?? '-', url: videoUrl }];
        }
        try {
            const filename = `yollomi_${modelId}_${Date.now()}.mp4`;
            const { path: fp, size } = await downloadOutput(videoUrl, outputDir, filename);
            if (credits !== undefined)
                log.status(`Credits remaining: ${credits}`);
            return [{ status: 'saved', file: path.relative('.', fp), size: fmtBytes(size), credits: credits ?? '-', url: videoUrl }];
        }
        catch {
            return [{ status: 'download-failed', file: '-', size: '-', credits: credits ?? '-', url: videoUrl }];
        }
    },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Retry with a different prompt (per the error hint) — content or generation failures are the usual cause
  2. Try a different modelId to rule out a model-specific outage
  3. Verify the input image (if using image-to-video) is valid and reachable
  4. Inspect the raw response in the bridged Chrome network tab; update the CLI if the response schema changed

Example fix

// before
yollomi video --model old-model --prompt "asdf"
// EMPTY_RESPONSE: No video returned
// after
yollomi video --model current-video-model --prompt "a timelapse of a sunset over mountains"
Defensive patterns

Strategy: retry

Validate before calling

// Validate prompt and model before spending generation time
if (!prompt || prompt.trim().length < 3) throw new Error('Prompt too short');
if (!allowedModels.includes(modelId)) throw new Error(`Unknown modelId: ${modelId}`);

Type guard

function hasVideoUrl(data) {
  return typeof data?.video === 'string' && data.video.length > 0;
}

Try / catch

try {
  const out = await generateVideo(page, { modelId, prompt });
} catch (e) {
  if (e.code === 'EMPTY_RESPONSE') {
    console.error('No video returned — retrying with adjusted prompt/model');
    return generateVideo(page, { modelId: fallbackModelId, prompt: sanitizedPrompt });
  }
  throw e;
}

Prevention

When it happens

Trigger: yollomiPost to /api/ai/video succeeds but data.video is empty/undefined — e.g. the model failed to produce output, the prompt was rejected silently, or the response schema differs from expected.

Common situations: Prompts that trip content filters or time out on the backend, unsupported/renamed modelId after an API update, an input image that fails processing, or a backend incident returning partial JSON.

Related errors


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