For the sauce: heat oil and chili flakes. Sauté onion and garlic, transfer to a blender. Add ingredients for sauce except for water. Turn blender on high and slowly add hot water until you achieve a creamy pourable consistency. Reserve that water for the pasta!
Heat oil in same pan, add mushrooms and garlic. Sauté for a couple minutes, add in remaining beans and pasta. Toss toss. Add in sauce and gently toss together adding in more pasta water if it’s too thick. Serve immediately.