Heat olive oil in a large pot over medium heat, add the chopped onion, and cook until soft and translucent, then stir in the garlic and cook briefly until fragrant.
Add the dry pasta and vegetable broth to the pot, bring to a gentle simmer, and cook while stirring occasionally until the pasta is tender and most of the liquid is absorbed.
Lower the heat, stir in the cream and pesto until smooth and creamy, season with salt, black pepper, and chili flakes, then let it rest for one minute before serving.