For the carrot sauce, sauté onion and garlic in butter. Add carrots and sugar and fry briefly.
Add soup, bring to a boil. Reduce temperature, steam carrots with lid closed until soft, about 15 minutes.
Puree carrots together with cooking liquid. Stir in cream and thyme. Season sauce.
In the meantime, cook spaghetti in salted water until al dente.
Mix walnuts and carrot sauce with spaghetti and serve.