1. Preheat oven to 375 degrees F. Line a baking sheet with foil or parchment. Cut spaghetti squashes in half lengthwise and scoop out seeds and loose stringy pulp from the center cavity. Place halves cut-side-down the prepared baking sheet and roast until the squash is soft when you press down on it, 40 to 60 minutes total. Flip it over and try to scrape up the spaghetti-like flesh, to check if it is done. If it is loose and stringy it is done. It shouldn’t be watery. If it doesn’t come up easily, return to the oven and check again in ten minutes.
2. Meanwhile, swirl oil in an unheated large heavy skillet, add onion and place over medium-high heat. Cook, stirring occasionally until the onion is softening and starting to brown, 6 to 8 minutes. Reduce heat to medium-low and continue cooking, stirring occasionally until the onions are soft and brown, 6 to 8 minutes. Add mushrooms, rosemary, salt and pepper. Increase heat to medium-high and cook stirring often until the mushrooms release their juices and the juices evaporate and a brown fond develops on the bottom of the skillet, 4 to 6 minutes. Whisk broth and garlic puree in a small bowl until smooth. Stir into the mushroom and onion mixture and bring to a boil. Cook until the sauce is thickened, 2 to 3 minutes.
3. Scrape spaghetti squash up from the shell with a fork. Serve squash topped with the sauce and chopped basil or parsley.