{"record":{"id":"858657b2464c5796","repo":"nexu-io/open-design","slug":"volcengine-task-response-missing-id","errorCode":null,"errorMessage":"volcengine task response missing id","messagePattern":"volcengine task response missing id","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/daemon/src/media/index.ts","lineNumber":1458,"sourceCode":"    method: 'POST',\n    headers: {\n      'authorization': `Bearer ${credentials.apiKey}`,\n      'content-type': 'application/json',\n    },\n    body: JSON.stringify(taskBody),\n  }));\n  const taskText = await taskResp.text();\n  if (!taskResp.ok) {\n    throw new Error(`volcengine task create ${taskResp.status}: ${truncate(taskText, 240)}`);\n  }\n  let taskData: any;\n  try {\n    taskData = JSON.parse(taskText);\n  } catch {\n    throw new Error(`volcengine non-JSON: ${truncate(taskText, 200)}`);\n  }\n  const taskId = taskData && taskData.id;\n  if (!taskId) throw new Error('volcengine task response missing id');\n\n  // Poll until succeeded/failed. Keep a hard cap, but make it long\n  // enough for real Seedance queues: fast t2v often returns in 30-120s,\n  // while i2v and busy-region t2v can exceed the old 6-minute ceiling.\n  const startedAt = Date.now();\n  const configuredMaxMs = Number(process.env.OD_VOLCENGINE_VIDEO_MAX_POLL_MS);\n  const maxMs =\n    Number.isFinite(configuredMaxMs) && configuredMaxMs >= 60_000\n      ? configuredMaxMs\n      : 12 * 60 * 1000;\n  let videoUrl: string | null = null;\n  let lastStatus = '';\n  // Emit a \"task accepted\" line right away so the agent's chat shows\n  // something within the first second instead of going silent for the\n  // full poll loop. cc's Bash tool considers a long-quiet pipe stuck\n  // and times out at ~2 minutes — Volcengine i2v routinely takes\n  // 3-5 minutes, so without this stream, every i2v dispatch dies\n  // mid-flight.","sourceCodeStart":1440,"sourceCodeEnd":1476,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/media/index.ts#L1440-L1476","documentation":"Thrown when the task-creation JSON parses successfully but has no `id` field. The Seedance async protocol requires `{ id }` from creation to poll, so without it the renderer cannot continue and fails fast rather than polling a bogus task.","triggerScenarios":"Parsed JSON with a falsy `taskData.id`. Happens when the endpoint returns an error envelope with a 2xx status (e.g. `{ error: {...} }` with no `id`), when a `baseUrl` override points at a different Ark API version that returns a different shape, or when the account lacks permission and the API returns a partial body.","commonSituations":"(1) Account permission error returned as 2xx `{error}` with no `id`; (2) wrong API path/version in `baseUrl`; (3) model id accepted but not deployed, returning a stub body.","solutions":["Log/inspect the full parsed body to see what Volcengine returned alongside the missing `id` (often an embedded `error`).","Confirm the API path is `/api/v3/contents/generations/tasks` and the model is activated.","Verify the ARK key has access to the Seedance model and that the model is deployed in the target region."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"function isVolcengineTaskCreated(d: unknown): d is { id: string } {\n  return typeof (d as any)?.id === 'string' && (d as any).id.length > 0;\n}\nif (!isVolcengineTaskCreated(taskData)) {\n  throw new Error(`volcengine task response missing id: ${JSON.stringify(taskData).slice(0, 200)}`);\n}","tryCatchPattern":null,"preventionTips":["Inspect the full parsed body when `id` is missing — it often contains an embedded `error`.","Confirm the API path version matches the response schema (`/api/v3/...`).","Verify the account has permission to create tasks for the model."],"tags":["volcengine","ark","seedance","response-shape"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}