This is not an example of nor even an attempt at long horizon thinking. Voyager wasn't built with the intention that it would last for decades. It was a rush job to take advantage of a very rare planetary alignment and it's primary mission was completed 12 years after it started.

It is a testament to the ingenuity of the engineers who have worked and are still working on the project that they've managed to keep it to some degree functioning for so much longer than it was intended to last.

I loved watching "It's quieter in the twilight", a documentary about how a dedicated team of engineers (mostly retired) are fighting to keep the Voyager mission alive.

https://m.imdb.com/title/tt17658964/

Given JavaScript, my headcannon is our galaxy is actually full of "rush jobs" probes from different species.

Also a testament to their foresight that it managed to send back useful data decades after the end of the mission, for instance when it crossed the heliosphere.

This wasn’t foresight. As the comment you responded to stated, the Voyager probes were built to explore the outer planets, nothing less and nothing more. The fact that they are still working is essentially a fortunate coincidence, helped by there not being much that can damage a spacecraft in outer space.

Just like Opportunity lasted for 15 years, while its identical twin Spirit only lasted for 6. The Voyager probes could easily have failed long ago, they just didn’t. But not because of planning or foresight. Sometimes things simply work out well.