{"record":{"id":"28f8733f39c808d5","repo":"vercel/ai","slug":"alibaba-video-generation-error","errorCode":"ALIBABA_VIDEO_GENERATION_ERROR","errorMessage":"No video URL in response. Task ID: ${taskId}","messagePattern":"No video URL in response\\. Task ID: (.+?)","errorType":"error_code","errorClass":"AISDKError","httpStatus":null,"severity":"error","filePath":"packages/alibaba/src/alibaba-video-model.ts","lineNumber":545,"sourceCode":"    responseHeaders: Record<string, string> | undefined,\n    warnings: SharedV4Warning[],\n    currentDate: Date,\n  ): {\n    status: 'completed';\n    videos: Array<{ type: 'url'; url: string; mediaType: string }>;\n    warnings: SharedV4Warning[];\n    providerMetadata: SharedV4ProviderMetadata;\n    response: {\n      timestamp: Date;\n      modelId: string;\n      headers: Record<string, string> | undefined;\n    };\n  } {\n    const taskId = statusResponse.output?.task_id;\n    const videoUrl = statusResponse.output?.video_url;\n\n    if (!videoUrl) {\n      throw new AISDKError({\n        name: 'ALIBABA_VIDEO_GENERATION_ERROR',\n        message: `No video URL in response. Task ID: ${taskId}`,\n      });\n    }\n\n    return {\n      status: 'completed',\n      videos: [\n        {\n          type: 'url',\n          url: videoUrl,\n          mediaType: 'video/mp4',\n        },\n      ],\n      warnings,\n      response: {\n        timestamp: currentDate,\n        modelId: this.modelId,","sourceCodeStart":527,"sourceCodeEnd":563,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/alibaba/src/alibaba-video-model.ts#L527-L563","documentation":"After video generation completes, the provider polls the task status. If the completed status response lacks output.video_url, buildCompletedResult throws an ALIBABA_VIDEO_GENERATION_ERROR because there is no result to return. This indicates an unexpected response shape from DashScope despite a 'succeeded' task status.","triggerScenarios":"Polling a completed Wan video task via doStatus where statusResponse.output.task_id exists but output.video_url is missing or named differently (API change, partial response).","commonSituations":"DashScope API shape changes, region/account configurations returning different fields, or task finished with a non-success state the provider misclassified as completed.","solutions":["Log the full statusResponse to inspect actual output fields","Verify the model ID and API version produce video_url on completion (e.g. wan2.2-t2i vs wan endpoints)","Retry the generation task; if persistent, report the raw response to the provider/SDK issue tracker"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Cannot validate before call; validate after polling completes:\nif (status.output?.task_status === 'succeeded' && !status.output?.video_url) retryOrFail();","typeGuard":"function hasVideoUrl(r: unknown): r is { output: { video_url: string; task_id: string } } {\n  return !!(r as any)?.output?.video_url;\n}","tryCatchPattern":"try {\n  result = await generateVideo({ model, prompt });\n} catch (e) {\n  if (AISDKError.isInstance(e) && e.name === 'ALIBABA_VIDEO_GENERATION_ERROR') {\n    // inspect status response, optionally re-poll or resubmit task\n  }\n}","preventionTips":["Poll to a terminal status before treating a task as complete","Log the raw status JSON for debugging unexpected shapes","Track DashScope API changelog for response schema changes"],"tags":["video-generation","api-response","missing-field"],"backgroundTag":"missing-video-url-in-response","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}