Sauté the onions and butter in your pressure cooker or prepare in a large soup pot on the stove. If you're using mushrooms, add them at this point as well.
Keep stirring frequently, scraping the bottom of the pot. Cook until the onions turn brown. It can take up to 25 minutes, but it is important. The caramelization is key.
When the onions are nicely brown and caramelized, add the thyme and garlic and stir.
Then add the wine and cook, uncovered, until it reduces, and the alcohol, and most of the liquid, has cooked off.
Sprinkle flour over mixture and stir. Cook for a minute, stirring, to make sure the raw taste of the flour gets cooked out.
Stir in the beef broth and bay leaf. Either bring to a simmer on the stove or turn to soup mode on pressure cook and let cook for 10 minutes under high pressure.
Release the pressure once cooked or simmer on low for 25 minutes and scrape the bottom to prevent onions from burning. Remove the bay leaf.
Place the bread on top of the soup and then the cheese and place the lid on and let steam for 1 minute. Or turn on the broiler to 450 degree and dish up the soup into oven safe bowls and place the bowls on a baking sheet place a slice of bread on top of each and slice of the cheese over each of the bread slices and broil for 30 seconds to 1 minute.Enjoy!