{"record":{"id":"e4fa39d576f4789c","repo":"nexu-io/open-design","slug":"vela-video-gen-response-is-missing-task-id","errorCode":null,"errorMessage":"Vela video gen response is missing task_id","messagePattern":"Vela video gen response is missing task_id","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/daemon/src/media/vela.ts","lineNumber":471,"sourceCode":"      '--prompt',\n      input.prompt,\n      '--ratio',\n      ratio,\n      '--resolution',\n      DEFAULT_VELA_VIDEO_RESOLUTION,\n      ...(input.length == null ? [] : ['--duration', String(input.length)]),\n      ...(firstFrame ? ['--first-frame', firstFrame.abs] : []),\n      ...references.flatMap((image) => ['--ref', image.abs]),\n      '--no-wait',\n      '--json',\n    ];\n    const submitStdout = await runCommand(submitArgs, {\n      ...velaWorkspaceCommandOptions(input.workspaceId),\n      timeoutMs: VELA_VIDEO_SUBMIT_TIMEOUT_MS,\n    });\n    const submitted = parseJsonObject(submitStdout, 'video gen');\n    const taskId = nonEmptyString(submitted.task_id);\n    if (!taskId) throw new Error('Vela video gen response is missing task_id');\n    lastStatus = nonEmptyString(submitted.status) ?? 'queued';\n    input.onProgress?.(`Vela video task ${taskId} accepted; polling status ${lastStatus}`);\n\n    while (Date.now() - startedAt < totalTimeoutMs) {\n      await wait(Math.min(pollIntervalMs, Math.max(1, totalTimeoutMs - (Date.now() - startedAt))));\n      if (Date.now() - startedAt >= totalTimeoutMs) break;\n\n      const pollStdout = await runCommand(\n        ['video', 'get', taskId, '--output', outputPath, '--json'],\n        {\n          ...velaWorkspaceCommandOptions(input.workspaceId),\n          timeoutMs: pollCommandTimeoutMs,\n        },\n      );\n      const task = parseJsonObject(pollStdout, 'video get');\n      const returnedTaskId = nonEmptyString(task.task_id);\n      if (returnedTaskId !== taskId) {\n        throw new Error(","sourceCodeStart":453,"sourceCodeEnd":489,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/media/vela.ts#L453-L489","documentation":"After submitting a Vela video generation request via 'vela video gen', the parsed JSON response lacks a non-empty task_id string. The submission is expected to return an object with task_id for subsequent polling via 'vela video get'. This fires when nonEmptyString(submitted.task_id) returns null.","triggerScenarios":"The Vela CLI returns valid JSON without a task_id field; task_id is present but empty/null/whitespace; the CLI returned an error envelope that still parsed as a JSON object; API version mismatch where the response shape changed.","commonSituations":"Vela CLI version mismatch with the daemon's expected contract; workspace lacks video generation permissions; quota/billing exhausted and the CLI returns an error JSON without a task_id; session expired and the CLI returned an auth-error JSON object.","solutions":["Check the Vela CLI version matches the expected API contract","Verify the workspace ID has video generation permissions and active quota","Re-authenticate with the Vela CLI (vela login) if the session expired","Inspect the full submit response JSON by adding debug logging around parseJsonObject"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const result = await renderVelaVideo(input);\n} catch (err) {\n  if (err.message.includes('missing task_id')) {\n    // Submission failed — check Vela CLI auth and version, then retry\n    logger.error('Vela video submission failed: no task_id in response', err);\n    throw new UserFacingError('Video submission failed. Please verify Vela authentication and try again.');\n  }\n  throw err;\n}","preventionTips":["Ensure the Vela CLI is authenticated (vela login) before starting video generation","Keep the Vela CLI version aligned with the daemon's expected API contract","Monitor for quota/billing exhaustion on the Vela workspace"],"tags":["vela","video","external-api","task-submission"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}