Preheat the oven to 375. Make the agrodolce sauce: Heat 3 tablespoons olive oil, the rosemary, whole garlic cloves and pepper flakes in a small saucepan over low heat, stirring, until the garlic is tender, 8 minutes. Set aside 1 tablespoon of the garlic oil. Add the vinegar and sugar to the pan; simmer over medium-low heat until syrupy and caramelized, 5 minutes.
Halve the squash lengthwise and remove the seeds. Brush the cut sides with the reserved garlic oil and season with salt and pepper. Place cut-side up in a baking dish and roast until tender, 1 hour. Reduce the oven to 200. Hold the squash with a towel; using a fork, pull off flesh in strands and place in the baking dish. Season with salt and pepper, cover with foil and keep warm in the oven.
Heat 1 tablespoon olive oil in a large nonstick skillet over medium-high heat. Add the mushrooms, season with salt and cook, stirring, until browned, 10 minutes. Transfer to a plate. Add the remaining 1 tablespoon olive oil to the skillet; add the tomatoes and toss until they blister. Add 1 tablespoon of the agrodolce sauce and a splash of water; cover and cook until the tomatoes burst, 5 minutes. Return the mushrooms to the pan and warm through.
Meanwhile, bring 1 inch of water to a boil in a saucepan over medium-high heat. Season the fish with salt and pepper, then place in a bamboo or collapsible steamer over the water; cover and steam until almost cooked through, 5 to 6 minutes. Remove from the heat and keep covered to finish cooking, 2 to 4 minutes.
Place a fish fillet on each of 4 plates; add the squash, mushrooms and tomatoes. Drizzle with the agrodolce sauce. Serve with extra sauce and the caramelized garlic.