{"record":{"id":"1d2c7138ac9abe65","repo":"jackwener/OpenCLI","slug":"empty-response-1d2c71","errorCode":"EMPTY_RESPONSE","errorMessage":"EMPTY_RESPONSE","messagePattern":"EMPTY_RESPONSE","errorType":"error_code","errorClass":"CliError","httpStatus":null,"severity":"error","filePath":"clis/yollomi/video.js","lineNumber":39,"sourceCode":"        { name: 'ratio', default: '16:9', choices: ['1:1', '16:9', '9:16', '4:3', '3:4'], help: 'Aspect ratio' },\n        { name: 'output', default: './yollomi-output', help: 'Output directory' },\n        { name: 'no-download', type: 'boolean', default: false, help: 'Only show URL, skip download' },\n    ],\n    columns: ['status', 'file', 'size', 'credits', 'url'],\n    func: async (page, kwargs) => {\n        const prompt = kwargs.prompt;\n        const modelId = kwargs.model;\n        const inputs = {\n            aspect_ratio: kwargs.ratio,\n        };\n        if (kwargs.image)\n            inputs.image = kwargs.image;\n        const body = { modelId, prompt, inputs };\n        log.status(`Generating video with ${modelId} (may take a while)...`);\n        const data = await yollomiPost(page, '/api/ai/video', body);\n        const videoUrl = data.video || '';\n        if (!videoUrl)\n            throw new CliError('EMPTY_RESPONSE', 'No video returned', 'Try a different prompt or model');\n        const credits = data.remainingCredits;\n        const noDownload = kwargs['no-download'];\n        const outputDir = kwargs.output;\n        if (noDownload) {\n            return [{ status: 'generated', file: '-', size: '-', credits: credits ?? '-', url: videoUrl }];\n        }\n        try {\n            const filename = `yollomi_${modelId}_${Date.now()}.mp4`;\n            const { path: fp, size } = await downloadOutput(videoUrl, outputDir, filename);\n            if (credits !== undefined)\n                log.status(`Credits remaining: ${credits}`);\n            return [{ status: 'saved', file: path.relative('.', fp), size: fmtBytes(size), credits: credits ?? '-', url: videoUrl }];\n        }\n        catch {\n            return [{ status: 'download-failed', file: '-', size: '-', credits: credits ?? '-', url: videoUrl }];\n        }\n    },\n});","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/yollomi/video.js#L21-L57","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Retry with a different prompt (per the error hint) — content or generation failures are the usual cause","Try a different modelId to rule out a model-specific outage","Verify the input image (if using image-to-video) is valid and reachable","Inspect the raw response in the bridged Chrome network tab; update the CLI if the response schema changed"],"exampleFix":"// before\nyollomi video --model old-model --prompt \"asdf\"\n// EMPTY_RESPONSE: No video returned\n// after\nyollomi video --model current-video-model --prompt \"a timelapse of a sunset over mountains\"","handlingStrategy":"retry","validationCode":"// Validate prompt and model before spending generation time\nif (!prompt || prompt.trim().length < 3) throw new Error('Prompt too short');\nif (!allowedModels.includes(modelId)) throw new Error(`Unknown modelId: ${modelId}`);","typeGuard":"function hasVideoUrl(data) {\n  return typeof data?.video === 'string' && data.video.length > 0;\n}","tryCatchPattern":"try {\n  const out = await generateVideo(page, { modelId, prompt });\n} catch (e) {\n  if (e.code === 'EMPTY_RESPONSE') {\n    console.error('No video returned — retrying with adjusted prompt/model');\n    return generateVideo(page, { modelId: fallbackModelId, prompt: sanitizedPrompt });\n  }\n  throw e;\n}","preventionTips":["Retry with a modified prompt on failure","Keep modelIds updated with the API's current catalog","Verify image-to-video inputs are valid before long generations"],"tags":["cli","video-generation","empty-response","prompt"],"backgroundTag":"empty-api-response","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}