{"record":{"id":"3934377d72c07a6b","repo":"vercel/ai","slug":"minimax-video-generation-cancelled","errorCode":"MINIMAX_VIDEO_GENERATION_CANCELLED","errorMessage":"MiniMax video generation was cancelled. Task ID: ${taskId}","messagePattern":"MiniMax video generation was cancelled\\. Task ID: (.+?)","errorType":"exception","errorClass":"AISDKError","httpStatus":null,"severity":"error","filePath":"packages/minimax/src/minimax-video-model.ts","lineNumber":669,"sourceCode":"                      },\n                    }\n                  : {}),\n              },\n            },\n          };\n        }\n\n        case 'failed': {\n          throw new AISDKError({\n            name: 'MINIMAX_VIDEO_GENERATION_FAILED',\n            message: `MiniMax video generation failed${\n              task.error?.message ? `: ${task.error.message}` : ''\n            }${task.error?.code != null ? ` (${task.error.code})` : ''}. Task ID: ${taskId}`,\n          });\n        }\n\n        case 'cancelled': {\n          throw new AISDKError({\n            name: 'MINIMAX_VIDEO_GENERATION_CANCELLED',\n            message: `MiniMax video generation was cancelled. Task ID: ${taskId}`,\n          });\n        }\n\n        case 'expired': {\n          throw new AISDKError({\n            name: 'MINIMAX_VIDEO_GENERATION_EXPIRED',\n            message: `MiniMax video generation request expired. Task ID: ${taskId}`,\n          });\n        }\n\n        // 'queued' | 'running' | unknown → keep polling.\n        default:\n          break;\n      }\n    }\n  }","sourceCodeStart":651,"sourceCodeEnd":687,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/minimax/src/minimax-video-model.ts#L651-L687","documentation":"The MiniMax video provider polled the task status endpoint and MiniMax reported the generation task as 'cancelled'. The SDK aborts doGenerate with an AISDKError named MINIMAX_VIDEO_GENERATION_CANCELLED so the caller knows no video will ever be produced for this task.","triggerScenarios":"Calling generateVideo (or the model's doGenerate) and, while polling, the MiniMax API returns task.status === 'cancelled' for the submitted taskId. Usually caused by an explicit cancellation of the task on MiniMax's side (dashboard/API) or an account/service-level cancellation.","commonSituations":"Someone or something cancelled the job in the MiniMax console; the task was cancelled programmatically via MiniMax's task management API; MiniMax cancelled the job due to content moderation or account limits.","solutions":["Submit a new video generation request (the cancelled task will never complete).","Check the MiniMax console/API for the task ID in the message to see who/what cancelled it.","If you cancel tasks yourself, make sure your cancellation logic isn't racing the polling loop.","Review MiniMax account limits or content-policy rejections that may cause automatic cancellation."],"exampleFix":"// before: reuse a stale taskId\ngenerateVideo({ model: minimax.video('video-01'), prompt });\n// after: handle cancellation and resubmit\ntry {\n  await generateVideo({ model: minimax.video('video-01'), prompt });\n} catch (e) {\n  if (e.name === 'MINIMAX_VIDEO_GENERATION_CANCELLED') {\n    await generateVideo({ model: minimax.video('video-01'), prompt });\n  }\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await generateVideo({ model: minimax.video('video-01'), prompt });\n} catch (error) {\n  if (\n    typeof error === 'object' && error !== null &&\n    (error as { name?: string }).name === 'MINIMAX_VIDEO_GENERATION_CANCELLED'\n  ) {\n    // resubmit a fresh generation task\n  } else {\n    throw error;\n  }\n}","preventionTips":["Don't cancel tasks in the MiniMax console while your app is polling them.","Wrap long-running generation in resubmit-on-terminal-status logic.","Persist task IDs with their status so cancelled tasks aren't re-polled."],"tags":["minimax","video-generation","task-cancelled","async-polling"],"backgroundTag":"task-cancelled-by-provider","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}