In a large pot, heat the olive oil over medium heat. Add the sliced onions and cook, stirring frequently, until they are caramelized and golden brown, about 15-20 minutes.
Add the minced garlic to the pot and cook for an additional 1-2 minutes until fragrant.
Stir in the vegetable broth, balsamic vinegar, dried thyme, sugar, salt, and pepper. Bring the mixture to a boil.
Add the pasta to the pot, reduce the heat to a simmer, and cover. Cook for 10-12 minutes, stirring occasionally, until the pasta is al dente and has absorbed most of the liquid.
Remove the pot from heat and stir in the Gruyère and Parmesan cheeses until melted and creamy.
Serve immediately, garnished with fresh parsley.