Pearl onions are easier to peel after being soaked for five minutes in very hot water.
Place the beans in a medium bowl, and cover with 2 inches of cold water. Soak them overnight.
Heat oven to 350 degrees. Cut a lid into the top of each pumpkin. Remove seeds, and reserve for toasting. Rub the inside of each pumpkin with olive oil, and sprinkle lightly with salt and freshly ground pepper. Place pumpkins, right-side up, and lids on parchment-lined baking sheets, and bake for 30 minutes. Turn pumpkins over, and continue to bake until tender but firm, about 30 minutes more. Set aside.
Place the bay leaves, thyme, and peppercorns in a six-inch square of cheesecloth. Draw up the edges, and tie the bundle with a piece of kitchen twine; set aside. Drain navy beans, and place in a medium stockpot. Add the chicken stock, onion, and cheesecloth bundle. Bring to a boil, reduce heat, cover, and simmer until the beans are tender, about 30 minutes. Drain the beans, reserving the cooking liquid. Discard the cheesecloth bundle.
In a large stockpot, melt the butter over medium-high heat. Add the leeks, carrots, celery, pearl onions, and potatoes. Saute until softened, about 12 minutes. Add the sausage, and cook until browned, about 5 minutes. Stir in peas and mushrooms. Sprinkle in flour, and cook 2 minutes. Reduce heat to medium, add the milk and reserved cooking liquid, and stir stew until it thickens, about 20 minutes. Stir in beans and sage. Divide stew among pumpkins, and return to the oven; bake until pumpkins are soft and stew is heated through, about 15 minutes. Garnish with thyme leaves, if using. Serve hot.