Nobody knows how many troops Ukraine has left (many military analysts and insiders say that manpower isn't an issue though) but we do know they have a bunch of newly formed brigades (thousands per brigade) and not a single one has been sent to Bakhmut so I don't think Ukraine intends on assaulting Bakhmut, they can take their time slowly encircling it.
Wagner is NOT a defensive force either, they are an attacking force, they will either be pulled out of Bakhmut to attack elsewhere (against fresh Ukrainian troops) or attempt to push from Bakhmut, Russia will swap the Wagner forces out for Russian troops, either veterans or fresh conscripts, either one has a nightmare to defend and we've seen the quality of Russia's veteran units being slaughtered in Vulhedar.
Russia has spent almost all of its offensive capability (no, taking a tiny city after 9 months, thousands of lives and hundreds of vehicles doesn't count for much), they can only defend the lines they have, Ukraine only needs to hold Bakhmut area lines until their offensive starts, if they achieve a breakthrough then we'll likely see another Russian panic.
Wagner has literally flattened Bakhmut, there is nothing left able to defend, there is no defensible positions, Ukraine doesn't need to roll into the city, they just need to get into a good position around the city and then artillery and bomb the shit out of it and force the Russians to retreat. In addition, Ukraine will have the high ground around Bakhmut over the city if they push an encirclement further.
If Russia could do #2 then they would have done #2 already.