{"record":{"id":"c596b20311d6ae9c","repo":"nexu-io/open-design","slug":"volcengine-task-did-not-finish-in-time-last-statu","errorCode":null,"errorMessage":"volcengine task did not finish in time (last status: ${lastStatus || 'unknown'})","messagePattern":"volcengine task did not finish in time \\(last status: (.+?)\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/daemon/src/media/index.ts","lineNumber":1515,"sourceCode":"    // Forward each poll tick. Heartbeat doubles as a \"command is alive\"\n    // signal for the agent's bash tool — the daemon's SSE stream emits\n    // an event for every line, which cc renders into the chat as live\n    // output so its watchdog never marks the call as hung.\n    if (typeof onProgress === 'function') {\n      const elapsedSec = Math.round((Date.now() - startedAt) / 1000);\n      onProgress(`volcengine task ${taskId} status=${lastStatus || 'pending'} (elapsed ${elapsedSec}s)`);\n    }\n    if (lastStatus === 'succeeded') {\n      videoUrl = pollData?.content?.video_url || null;\n      break;\n    }\n    if (lastStatus === 'failed' || lastStatus === 'cancelled') {\n      const reason = pollData?.error?.message || lastStatus;\n      throw new Error(`volcengine task ${lastStatus}: ${reason}`);\n    }\n  }\n  if (!videoUrl) {\n    throw new Error(`volcengine task did not finish in time (last status: ${lastStatus || 'unknown'})`);\n  }\n\n  const dlResp = await fetch(videoUrl, withMediaRequestInit(ctx));\n  if (!dlResp.ok) throw new Error(`volcengine video fetch ${dlResp.status}`);\n  const arr = await dlResp.arrayBuffer();\n  const bytes = Buffer.from(arr);\n\n  return {\n    bytes,\n    providerNote: `volcengine/${ctx.wireModel} · ${ratio} · ${durationSec}s · ${bytes.length} bytes`,\n    suggestedExt: '.mp4',\n  };\n}\n\nfunction volcengineRatioFor(aspect?: string): string {\n  // Seedance accepts a fixed list of ratios; map the OD vocabulary to\n  // its canonical strings.\n  if (!aspect) return '16:9';","sourceCodeStart":1497,"sourceCodeEnd":1533,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/media/index.ts#L1497-L1533","documentation":"Thrown when the polling loop exits without the task reaching `succeeded` within the configured deadline. The default cap is 12 minutes (`12 * 60 * 1000`); `OD_VOLCENGINE_VIDEO_MAX_POLL_MS` overrides it but only values ≥ 60000 are honored. The last observed status is included so you can tell a still-queued task from a stuck one.","triggerScenarios":"`Date.now() - startedAt >= maxMs` before `status === 'succeeded'`. Real Seedance i2v or busy-region t2v can exceed 6 minutes; the 12-minute default covers most, but heavy queues or large resolutions can still time out.","commonSituations":"(1) Seedance queue saturated in the region; (2) i2v with a large reference image; (3) the default 12-min cap too short for a peak-traffic render.","solutions":["Increase the cap by setting `OD_VOLCENGINE_VIDEO_MAX_POLL_MS` (e.g. `1800000` for 30 min) in the daemon env; values below 60000 are ignored.","Retry at off-peak; switch region if the account supports it.","Reduce resolution/duration to shorten render time."],"exampleFix":"// before\nod media generate --surface video --model doubao-seedance-1-0-i2v --prompt '...'\n# → 'volcengine task did not finish in time (last status: running)'\n\n// after\nexport OD_VOLCENGINE_VIDEO_MAX_POLL_MS=1800000   # 30 min\nod media generate --surface video --model doubao-seedance-1-0-i2v --prompt '...'","handlingStrategy":"retry","validationCode":"// Bump the poll cap before rendering long i2v tasks.\nfunction ensureVolcengineTimeout(): void {\n  const v = Number(process.env.OD_VOLCENGINE_VIDEO_MAX_POLL_MS);\n  if (!Number.isFinite(v) || v < 60_000) {\n    process.env.OD_VOLCENGINE_VIDEO_MAX_POLL_MS = String(12 * 60 * 1000);\n  }\n}","typeGuard":null,"tryCatchPattern":"// Increase the cap and retry once for genuine long-queue timeouts.\nprocess.env.OD_VOLCENGINE_VIDEO_MAX_POLL_MS = String(30 * 60 * 1000);\nreturn await renderVolcengineVideo(ctx, credentials, onProgress);","preventionTips":["Set `OD_VOLCENGINE_VIDEO_MAX_POLL_MS` (≥60000) high enough for i2v and peak traffic.","Retry off-peak when the region's Seedance queue is saturated.","Reduce resolution/duration to shorten render time."],"tags":["volcengine","ark","seedance","video","timeout"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}