In a large pot over medium heat, melt the butter.
Add sliced onions, salt, and sugar. Cook, stirring often, until onions are golden and caramelized, about 30-40 minutes.
Stir in thyme and deglaze the pot with white wine, scraping up any browned bits.
Pour in beef stock and Worcestershire sauce. Bring to a boil, then reduce heat and simmer uncovered for 30 minutes. Season with salt and pepper.
While soup simmers, toast baguette slices until golden on both sides.
Ladle soup into oven-safe bowls, top with a slice or two of toasted baguette, and sprinkle generously with Gruyère cheese.
Broil in the oven until cheese is melted and bubbly. Serve hot.