In a large pot, heat the olive oil over medium heat. Add the diced onion and sauté for about 3-4 minutes until translucent.
Stir in the minced garlic, diced carrots, and diced celery. Cook for another 5 minutes until the vegetables are tender.
Add the dried thyme, dried oregano, and red pepper flakes (if using). Stir to combine and cook for 1 minute until fragrant.
Pour in the chicken broth and bring the mixture to a boil.
Once boiling, add the shredded chicken and potato gnocchi. Reduce the heat to a simmer and cook for about 5-7 minutes, or until the gnocchi float to the top.
Stir in the heavy cream and fresh spinach. Cook for an additional 2-3 minutes until the spinach wilts.
Season with salt and pepper to taste. Serve hot, topped with grated Parmesan cheese.