{"record":{"id":"e07d13db4093ea7e","repo":"jackwener/OpenCLI","slug":"qianwen-image","errorCode":"qianwen image","errorMessage":"No generated images observed before timeout.","messagePattern":"No generated images observed before timeout\\.","errorType":"exception","errorClass":"TimeoutError","httpStatus":null,"severity":"error","filePath":"clis/qwen/image.js","lineNumber":152,"sourceCode":"        if (!send?.ok) {\n            if (await hasLoginGate(page)) throw authRequired();\n            throw new CommandExecutionError(send?.reason || 'Failed to send Qianwen image prompt');\n        }\n\n        // Grab the newest assistant bubble id after send by polling briefly\n        let targetId = '';\n        for (let i = 0; i < 5; i += 1) {\n            await page.wait(1);\n            const bubbles = await getMessageBubbles(page);\n            const lastAnswer = [...bubbles].reverse().find((b) => b.role === 'Assistant');\n            if (lastAnswer) { targetId = lastAnswer.id; break; }\n        }\n\n        const waitResult = await waitForImageUrls(page, targetId, timeout);\n        const link = await page.evaluate('window.location.href').catch(() => 'https://www.qianwen.com/');\n        if (waitResult.status === 'auth_required') throw authRequired();\n        if (waitResult.status === 'timeout') {\n            throw new TimeoutError('qianwen image', timeout, 'No generated images observed before timeout.');\n        }\n\n        const urls = waitResult.urls;\n        if (skipDownload) {\n            return [{ Status: '🎨 generated', File: null, Link: link }];\n        }\n\n        const stamp = Date.now();\n        const results = [];\n        for (let i = 0; i < urls.length; i += 1) {\n            const url = urls[i];\n            const asset = await fetchImageAsset(page, url);\n            if (!asset?.ok) {\n                throw new CommandExecutionError(`Failed to fetch generated Qianwen image ${i + 1}: status=${asset?.status || '?'}`);\n            }\n            const suffix = urls.length > 1 ? `_${i + 1}` : '';\n            const ext = extFromMime(asset.mime);\n            const filePath = path.join(outputDir, `qianwen_${stamp}${suffix}${ext}`);","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/qwen/image.js#L134-L170","documentation":"clis/qwen/image.js polls waitForImageUrls(page, targetId, timeout) for generated image URLs; if the status comes back 'timeout' it throws TimeoutError('qianwen image', timeout, 'No generated images observed before timeout.'). Image generation simply did not produce any <img> result within the allotted seconds.","triggerScenarios":"Image generation takes longer than the --timeout value (default 180s); the prompt was rejected or the model returned text only; generation stalled after send; the target assistant bubble (targetId) never received image elements.","commonSituations":"Complex prompts queuing behind heavy server load; free-tier rate limiting slowing generation; very short custom timeouts (e.g. --timeout 30) on a feature that usually takes 1-3 minutes; content-policy refusal producing no images.","solutions":["Increase --timeout (e.g. 300-600) and retry — image generation often exceeds 180s under load","Simplify or rephrase the prompt; content-policy refusals produce no images at all","Verify the sent prompt actually started generating (check the chat in the browser)","Retry later if the service is degraded/queued — server-side latency is outside your control"],"exampleFix":"// before\nclis qwen image --prompt 'elaborate fantasy scene' --timeout 60\n// after\nclis qwen image --prompt 'elaborate fantasy scene' --timeout 600","handlingStrategy":"retry","validationCode":"null","typeGuard":"null","tryCatchPattern":"try {\n  const results = await runQianwenImage(prompt, { timeout: 600 });\n} catch (e) {\n  if (e instanceof TimeoutError && e.operation === 'qianwen image') {\n    console.warn(`No images after ${e.timeout}s; retrying once with a simpler prompt`);\n    await runQianwenImage(simplify(prompt), { timeout: 600 });\n  } else throw e;\n}","preventionTips":["Use generous timeouts (300-600s) for image generation, especially under load","Avoid prompts likely to trigger content refusals, which yield no images","Check the chat in the browser to confirm generation actually starts","Treat repeated timeouts as service degradation and back off rather than hammering retries"],"tags":["timeout","browser-automation","image-generation"],"backgroundTag":"operation-timeout","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}