Slice the onions in half and then in half again. Peel and slice into thick 1/2-inch slices.
In a small bowl using a fork, mix 1 tablespoon of the butter with 2 tablespoons cognac, mustard, and thyme leaves.
Preheat the broiler.
Melt the remaining butter into the olive oil in a Dutch oven. Add the onions. Cook very slowly on medium-high heat until they have a deep brown color, about 17 minutes. Turn the heat up to medium-high, add the sugar, and stir for 1 minute.
When onions are golden, remove from the heat, add the flour, and stir well to cover the onions. Pour in the stock, add the bouillon and bring to a boil. Turn down to a simmer and cook for 5 minutes. Add salt and pepper.
Whisk in the butter and cognac mixture and bring back to a low simmer until ready to serve.
Meanwhile, place the slices of baguette on the baking sheet. Equally divide the cheese on top of the slices and place under the broiler until the cheese is just melted and bubbly.
Serve slices alongside the soup, to dip.