SANTA CLARA — Kyle Shanahan and 49ers offensive line coach Chris Foerster spent the entire summer desperately praying someone, anyone, would save them from Connor Colby.

The second-year offensive lineman was handed the top job at left guard at the start of training camp, but not long after practices became padded, that decision was re-evaluated.

The Niners spent August holding open auditions like a panicked theater director staring down opening night. Throughout the preseason, they ran rookie Carver Willis, veteran Robert Jones, and even tackle Austen Pleasants with the first team, all while demoting Colby to the second, and eventually third, string. They were basically begging the universe to deliver them a semi-competent alternative.

It didn’t.

So as Shanahan packed his bags for the Niners’ trip to Australia, he also packed that hope — perhaps thinking some time in a different hemisphere would produce an answer to the 49ers offense’s biggest question mark heading into the season.

It did.

Wouldn’t you know it, the answer was Colby all along.

Colby didn’t just survive Melbourne. He was a standout performer, in a good way.

And now he has a chance to do what he couldn’t do last season or this preseason — cement himself as a Niners’ starter and every-down left guard.

For the last four seasons, the 49ers have treated at least one starting guard spot — first right, now left — as less of a football position and more like an open mic night at a dive bar, letting any tragic hopeful wander onstage just to watch them get booed off.

It was an endless carnival of blown assignments and turnstiles, all set to the terrifying soundtrack of Brock Purdy running for his life.

Left guard was looking like it was going to go that way again this season. And to be fair, it still might.

But Colby gave the Niners 65 competent snaps Down Under against what was billed as a ferocious Rams defensive front.

Zero sacks allowed. Zero penalties committed. Two pressures surrendered all afternoon. Ignore those Pro Football Focus numbers (those guys long ago lost the plot) — Colby played well in Australia.

Sure, the Rams played like a group that had just taken a 15-hour flight a day earlier and had every cell in their body fighting the fact that the sun was in the sky. And yes, Braden Fiske walked Colby straight back into the pocket once on a nasty bull rush, forcing Purdy to escape.

But Colby didn’t buckle on that rep. He anchored, reset his hands, and locked the vault. He scrapped. He found a way to win. Purdy found Mike Evans for a 13-yard gain.

In all, Colby’s play was a shocking revelation to anyone who watched his decline during his rookie season, and I’ll put myself first on that list.

Last fall, Colby stepped in against New Orleans in Week 2, looked passable for about three quarters, and then spent two months resembling a guy trying to halt an oncoming freight train with a foam pool noodle.

It was impossible not to notice. Opposing coaches watched him struggle in pass protection and repeatedly get walked into Purdy’s lap, and they smelled blood in the water. The Niners had to pull the plug on the experiment just a few weeks after they threw him into the mix.

It was somewhat predictable. Look at Colby’s draft profile coming out of Iowa, and you’ll find a riddle wrapped inside some beef. A reverse Wellington, if you will.

He has the raw horsepower — a truly rare brand of athleticism for an O-lineman — to push a silo across an interstate, but he plays with high hips and feet that oscillate between tap-dancing and looking like they’re submerged in wet cement.

Add in that he processed twists and stunts with the urgency of a dial-up modem, and it was all a bit too much to think that he was ready for prime time — much less the Rams in Week 1.

The Niners now spin the August left guard rotation as “competition,” but it wasn’t a grand plan to sharpen Colby for the start of the campaign.

With hindsight, though, that’s what it did.

Colby hands out clichés with the stoic detachment of a Midwestern corn farmer discussing an incoming frost.

“The only thing that was in my control was my effort, so that was it,” Colby told me at his locker Wednesday. “You go out there every day, give it everything you have, and wherever the cards fall, the cards fall.”

I can’t help but think that flatline pulse was exactly what Colby needed to survive the Niners’ training camp blender.

Most young players would wilt when their coaches publicly shop their job on the open market and give anyone with a pulse and 300 pounds a shot at the gig — especially after the experience of being benched the year prior.

Colby simply shrugged, kept playing, flew across the Pacific, and shoved Shanahan’s looming platoon plans right into the shredder.

“There was no plan on rotating players,” Shanahan said Wednesday. (Really, Kyle?) “It was tight throughout everything, but [we] felt a lot better with [Colby] during the week of practice that we had down there.”

Shanahan didn’t stop there, calling the group’s pass protection “unbelievable” against the Rams.

He wasn’t blowing smoke.

For the first time in years, Niners center Jake Brendel didn’t have to spend three hours calculating the exact angle of his guard’s next collapse. He and Colby even looked like they had some chemistry down in Australia — an auspicious signal.

“No one really wants musical chairs,” Brendel said of the constantly rotating guards. “That doesn’t instill confidence in anyone, in my opinion. It’s hard to play next to a revolving door.”

But Brendel has seen enough carousel rides to know when someone finally grabs the brass ring.

“The guy has got a lot of fight in him, for sure,” Brendel said. “Hopefully he just grabs onto it and [says that someone] has got to rip it out of his dead hands.”

“There is a lot of stuff I still need to improve on,” Colby told me. “Mostly it was pass protection things: using my away hand a little bit better.”

He’s right. Run blocking — Colby’s hallmark; the area where he had several flash plays against the Rams — is valuable. It’s why the Niners drafted him, and it’s what will keep him in the mix for years to come.

But it’s keeping the franchise quarterback in one piece on passing dropbacks that will keep him on top of the depth chart.

He did that in Week 1.

Now the question is whether, moving forward, he can consistently do it.

The Miami Dolphins stroll into Levi’s Stadium next, offering the easiest layup an offensive lineman could dream of. I deserve hazard pay for watching their performance against the Raiders last Sunday.

If ever there was an opportunity for Colby to stop the music and firmly take his place in the chair that is the starting left guard job, it’s this upcoming Sunday.

The fact that he’s even in that position, though, might just be the biggest surprise of the season yet.