In a large pot, melt butter over medium heat. Saute onion, celery, and carrots, if diced. Cook for 5 minutes, then add garlic and cook until fragrant (about 3 seconds to 1 minute).
Add flour and stir well for a minute to cook out raw flour. Splash in chicken broth, ½ cup at a time, whisking quickly to ensure no lumps. Pour in rest of chicken broth, half and half, (add shredded carrots at this time) shredded chicken, and thyme, then allow to simmer for five minutes.
Turn heat up to medium-high, almost to a boil, and add gnocchi. Let cook for 3 minutes, until gnocchi is cooked through and soup thickens. Turn heat off Toss in spinach and stir, then let wilt for 1-2 minutes.
Season with salt and pepper and cayenne to taste, then serve.