jackwener/OpenCLI · error · TimeoutError
qianwen image
qianwen image
Error message
No generated images observed before timeout.
What it means
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.
Source
Thrown at clis/qwen/image.js:152
if (!send?.ok) {
if (await hasLoginGate(page)) throw authRequired();
throw new CommandExecutionError(send?.reason || 'Failed to send Qianwen image prompt');
}
// Grab the newest assistant bubble id after send by polling briefly
let targetId = '';
for (let i = 0; i < 5; i += 1) {
await page.wait(1);
const bubbles = await getMessageBubbles(page);
const lastAnswer = [...bubbles].reverse().find((b) => b.role === 'Assistant');
if (lastAnswer) { targetId = lastAnswer.id; break; }
}
const waitResult = await waitForImageUrls(page, targetId, timeout);
const link = await page.evaluate('window.location.href').catch(() => 'https://www.qianwen.com/');
if (waitResult.status === 'auth_required') throw authRequired();
if (waitResult.status === 'timeout') {
throw new TimeoutError('qianwen image', timeout, 'No generated images observed before timeout.');
}
const urls = waitResult.urls;
if (skipDownload) {
return [{ Status: '🎨 generated', File: null, Link: link }];
}
const stamp = Date.now();
const results = [];
for (let i = 0; i < urls.length; i += 1) {
const url = urls[i];
const asset = await fetchImageAsset(page, url);
if (!asset?.ok) {
throw new CommandExecutionError(`Failed to fetch generated Qianwen image ${i + 1}: status=${asset?.status || '?'}`);
}
const suffix = urls.length > 1 ? `_${i + 1}` : '';
const ext = extFromMime(asset.mime);
const filePath = path.join(outputDir, `qianwen_${stamp}${suffix}${ext}`);View on GitHub (pinned to 49907e53dc)
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
Example fix
// before clis qwen image --prompt 'elaborate fantasy scene' --timeout 60 // after clis qwen image --prompt 'elaborate fantasy scene' --timeout 600
Defensive patterns
Strategy: retry
Validate before calling
null
Type guard
null
Try / catch
try {
const results = await runQianwenImage(prompt, { timeout: 600 });
} catch (e) {
if (e instanceof TimeoutError && e.operation === 'qianwen image') {
console.warn(`No images after ${e.timeout}s; retrying once with a simpler prompt`);
await runQianwenImage(simplify(prompt), { timeout: 600 });
} else throw e;
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
Related errors
- Unexpected 12306 probe: ${JSON.stringify(probe)}
- ChatGPT did not create a conversation URL after sending the
- chatgpt image
- No finished image appeared before timeout. Re-run with a hig
- ChatWise response
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/e07d13db4093ea7e.
Report an issue: GitHub.