Slice onions very thinly (this can also be done on a mandolin if you desire).
Heat a medium-sized pot or high-sided skillet over medium heat. Add the olive oil and once warm turn to medium-low and add the onions, sprinkle with salt and sugar. Cook, stirring occasionally until the onions are caramelized and golden, this can take about 25-30 minutes.
Pour in wine and balsamic vinegar. Deglaze the pan by scraping up any browned bits at the bottom of the pan. Stir in vegetable stock paste. Add 4 sprigs of thyme and stir in salt and pepper.
Add lentil pasta, water and tamari. Bring to a boil over high heat, stirring every few minutes to ensure pasta doesn't stick to the bottom of the pan and then reduce to medium-low, cover and cook for about 8-10 minutes or until al dente, stirring occasionally - the sauce should coat the pasta.
Sprinkle the gruyere cheese on top and put the lid back on with the pan on low. Let sit for a minute or two for the cheese to melt. Serve and enjoy!