There are always some open in every neighborhood. If you can tell me which area I may be able to help. For example, in Parioli where we lived, Taverna Rossini is open all summer. (At least they were when we lived there 2012-2016!) We also enjoyed several restaurants along Viale Liegi near Piazza Buenos Aires and into the Trieste neighborhood. We could walk to them from home, but you'd probably need a bus, tram, or taxi.
Elizabeth Minchilli is a reliable source, IMO.
Editing to say I guess you aren't going to Rome. Lucca is tiny. You won't find many places -- if any -- where there are not tourists dining.