vercel/ai · error · AISDKError

MINIMAX_VIDEO_GENERATION_CANCELLED

MINIMAX_VIDEO_GENERATION_CANCELLED

Error message

MiniMax video generation was cancelled. Task ID: ${taskId}

What it means

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.

Source

Thrown at packages/minimax/src/minimax-video-model.ts:669

                      },
                    }
                  : {}),
              },
            },
          };
        }

        case 'failed': {
          throw new AISDKError({
            name: 'MINIMAX_VIDEO_GENERATION_FAILED',
            message: `MiniMax video generation failed${
              task.error?.message ? `: ${task.error.message}` : ''
            }${task.error?.code != null ? ` (${task.error.code})` : ''}. Task ID: ${taskId}`,
          });
        }

        case 'cancelled': {
          throw new AISDKError({
            name: 'MINIMAX_VIDEO_GENERATION_CANCELLED',
            message: `MiniMax video generation was cancelled. Task ID: ${taskId}`,
          });
        }

        case 'expired': {
          throw new AISDKError({
            name: 'MINIMAX_VIDEO_GENERATION_EXPIRED',
            message: `MiniMax video generation request expired. Task ID: ${taskId}`,
          });
        }

        // 'queued' | 'running' | unknown → keep polling.
        default:
          break;
      }
    }
  }

View on GitHub (pinned to 69428b1f8b)

Solutions

  1. Submit a new video generation request (the cancelled task will never complete).
  2. Check the MiniMax console/API for the task ID in the message to see who/what cancelled it.
  3. If you cancel tasks yourself, make sure your cancellation logic isn't racing the polling loop.
  4. Review MiniMax account limits or content-policy rejections that may cause automatic cancellation.

Example fix

// before: reuse a stale taskId
generateVideo({ model: minimax.video('video-01'), prompt });
// after: handle cancellation and resubmit
try {
  await generateVideo({ model: minimax.video('video-01'), prompt });
} catch (e) {
  if (e.name === 'MINIMAX_VIDEO_GENERATION_CANCELLED') {
    await generateVideo({ model: minimax.video('video-01'), prompt });
  }
}
Defensive patterns

Strategy: try-catch

Try / catch

try {
  await generateVideo({ model: minimax.video('video-01'), prompt });
} catch (error) {
  if (
    typeof error === 'object' && error !== null &&
    (error as { name?: string }).name === 'MINIMAX_VIDEO_GENERATION_CANCELLED'
  ) {
    // resubmit a fresh generation task
  } else {
    throw error;
  }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30). Data as JSON: /api/errors/3934377d72c07a6b. Report an issue: GitHub.