Cook the pasta: Boil your pasta in salted water according to the package instructions. Reserve 1/4 cup of pasta water before draining.
Sauté the mushrooms and onions:
In a large skillet, heat the olive oil over medium heat.
Add the chopped onions and sauté until soft and translucent (about 3-4 minutes).
Add the garlic and mushrooms, cooking until the mushrooms are golden and have released their moisture (about 5-7 minutes).
Season with salt, pepper, and thyme.
Toast the walnuts: While the mushrooms are cooking, toast the chopped walnuts in a dry pan for 2-3 minutes until they are lightly browned and fragrant. Be careful not to burn them.
Add the stir-in pasta sauce: Pour the stir-in pasta sauce into the skillet with the mushroom mixture. Stir well to combine. If you want a creamier sauce, add the heavy cream at this point. Simmer the sauce for 5 minutes to allow the flavors to meld.
Add the walnuts: Stir in the toasted walnuts and cook for another 1-2 minutes.
Adjust consistency: If the sauce seems too thick, add a splash of reserved pasta water to reach your desired consistency.
Toss with pasta: Add the cooked pasta to the sauce and toss to combine, ensuring the pasta is fully coated.
Serve: Garnish with chopped fresh parsley and a sprinkle of Parmesan or vegan cheese if desired.