You remove the threaded valves from the box,
sweat in short pieces short enough to get back down into the box to nut up and tighten,
but long enough make the necessary soldering to connect far enough away where the heat of the soldering doesn't transfer heat to the box.
Usually those lengths are 6-8" depending on where the holes located in the box. If it is a 2 by 6 framed wall, you can run even longer lengths and make this possible.
Somewhere on my site I have a picture to this idea.....lemme see if I can find it.