Prep the onions: Peel and slice the onions thinly from root to tip.
Keep the slices even so they cook consistently.
Start the caramelization: In a large heavy pot or Dutch oven, melt the butter with the olive oil over medium heat. Add the onions, salt, and sugar (if using). Toss to coat.
Cook low and slow: Reduce the heat to medium-low and cook, stirring every few minutes.
Scrape the bottom often. This step takes 40–60 minutes. The onions should go from translucent to golden to deep brown.
If they start to scorch, lower the heat and add a splash of water to loosen the fond.
Add garlic and flour: Stir in the garlic and cook for 30 seconds until fragrant. Sprinkle in the flour and cook for 1–2 minutes to remove the raw taste. The onions will look a bit pasty—this is good.
Deglaze with wine: Pour in the wine (if using) and scrape up all the browned bits.
Let it bubble for 2–3 minutes to reduce slightly.
Simmer the soup: Add the broth, Worcestershire (if using), thyme, and bay leaf. Bring to a gentle simmer and cook for 20–30 minutes. Taste and adjust salt and pepper.
Toast the bread: While the soup simmers, toast the baguette slices on a sheet pan at 375°F (190°C) until crisp and lightly golden, about 8–10 minutes.
This keeps them from getting soggy.
Assemble for broiling: Ladle the soup into oven-safe bowls set on a sheet pan. Top each with 1–2 baguette slices and a generous mound of grated cheese.
Broil to finish: Place under the broiler for 2–4 minutes, watching closely, until the cheese melts and browns in spots. Let cool slightly before serving.
Serve: Add a crack of pepper and a few thyme leaves on top.
The cheese will be stretchy, the bread will be soaked just enough, and the broth will be deeply savory.