{"record":{"id":"951ea557515cfdc3","repo":"nexu-io/open-design","slug":"volcengine-task-laststatus-reason","errorCode":null,"errorMessage":"volcengine task ${lastStatus}: ${reason}","messagePattern":"volcengine task (.+?): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/daemon/src/media/index.ts","lineNumber":1511,"sourceCode":"    } catch {\n      throw new Error(`volcengine poll non-JSON: ${truncate(pollText, 200)}`);\n    }\n    lastStatus = pollData.status || '';\n    // 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","sourceCodeStart":1493,"sourceCodeEnd":1529,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/media/index.ts#L1493-L1529","documentation":"Thrown when a polled Seedance task reports a terminal `failed` or `cancelled` status. The message carries the status plus `pollData.error.message` (falling back to the status) so the provider's rejection reason — content moderation, resource exhaustion, user cancel — is shown.","triggerScenarios":"`pollData.status === 'failed'` or `'cancelled'`. Concrete: content-policy rejection of the prompt, source image disallowed for i2v, GPU resource exhaustion in the region, or the task was cancelled (manually or by quota revocation).","commonSituations":"(1) Prompt or input image tripped Volcengine content moderation; (2) regional GPU saturation causing Seedance to fail rather than queue; (3) account quota revoked mid-task.","solutions":["Read `reason` — moderation → reword prompt/swap image; resource exhaustion → switch region or retry later; cancelled → check the Volcengine console.","If i2v, ensure the reference image meets Seedance's size/format constraints.","Retry once after addressing the cited reason; do NOT blindly retry a moderation failure."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  return await renderVolcengineVideo(ctx, credentials, onProgress);\n} catch (err) {\n  const msg = err instanceof Error ? err.message : String(err);\n  if (/task failed/.test(msg) && /moderat|content/i.test(msg)) {\n    throw new Error('Seedance rejected the prompt on content grounds — reword and retry');\n  }\n  if (/resource|exhaust/i.test(msg)) { /* switch region or retry later */ }\n  throw err;\n}","preventionTips":["Never blindly retry a moderation failure — reword the prompt or swap the input image first.","For i2v, validate the reference image's size/format before submission.","On regional GPU exhaustion, retry off-peak or switch regions."],"tags":["volcengine","ark","seedance","video","moderation"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}