A visit by the NASA administrator to a rocket factory is usually a predictable show-and-tell of the latest gadgets destined for outer space.

But there may have been some tension below the surface last week when the current administrator, Jim Bridenstine, stopped by the headquarters of SpaceX, the private rocket company of billionaire Elon Musk, in Southern California. SpaceX is a major contractor for NASA.

He and Musk had been exchanging nettlesome messages for two weeks, and the visit might have been as much about smoothing over ruffled feelings as viewing space hardware.

Taking questions from reporters, both men were complimentary toward each other and said they shared the same goals: to launch NASA astronauts to the International Space Station on SpaceX’s Crew Dragon capsule as soon as possible, but not before the spacecraft had passed all of the needed tests.

“We’re honored to partner with NASA to make this happen,” Musk said. “This is a dream come true, really.”

The relationship between NASA and SpaceX has sometimes been fractious. The two are frenemies — odd, co-dependent bedfellows with shared dreams of pushing outward into the solar system, a cantankerous couple that cannot live with or without each other.

Absent NASA’s help and contracts over the past 13 years, SpaceX would not have become a powerhouse dominating the business of launching satellites to orbit. In return, SpaceX offers NASA cheaper costs for taking cargo — and in the coming months, perhaps, astronauts — to the space station.

But Musk has sometimes complained that NASA’s meticulous safety reviews were holding SpaceX back, while Bridenstine appeared to be wondering whether Musk’s dream of future Mars colonies was distracting the company from its obligations to NASA.

Last month, as Musk prepared to give an update on Starship, a giant spacecraft that he hopes could travel to Mars sometime in the next decade, Bridenstine posted a message on Twitter suggesting that SpaceX needed to pay more attention to its contract with NASA to launch astronauts to the space station aboard the Crew Dragon spacecraft.

Instead of building and operating its own spaceships as NASA did for the space shuttles, which were retired in 2011, the agency has now turned to SpaceX and Boeing to provide the transportation of astronauts.

Both Boeing and SpaceX are behind schedule in this “commercial crew” program, and their first crewed launches will probably not occur until sometime in 2020.

Adding to the tension are the years of delays and cost overruns in the development of NASA’s upcoming giant rocket, the Space Launch System. Critics of SLS have suggested that SpaceX could offer better alternatives for NASA’s planned large deep-space missions: either the future Starship, or the Falcon Heavy, which is smaller but already flying.

“Mr. Bridenstine is in a tough spot,” said Phil Larson, a former space adviser during the Obama administration and now an assistant dean at the University of Colorado’s engineering college. “That tweet came out of left field, and due to its tone, shines a spotlight on a number of NASA programs that are behind schedule and over budget.”

When asked about Bridenstine’s tweet during an interview with CNN after the Starship event, Musk replied jokingly — “Did he say commercial crew or SLS?” — then broke into laughter.

He also said that SpaceX could be ready to launch NASA’s astronauts in three to four months.

In another interview after the event, Musk said that the rockets and the Crew Dragon capsules for two upcoming commercial crew missions would be in Florida soon. The first is an uncrewed test of the abort system to make sure it can whisk the capsule with the astronauts to safety in case of a rocket failure on the way to orbit. The second is a demonstration flight that will take two NASA astronauts, Robert Behnken and Douglas Hurley, to the International Space Station.

“Actually, there’s nothing more we can do from a hardware standpoint,” Musk said. “The hardware is basically done. It’s really just a whole bunch of NASA reviews, essentially. Speed up the NASA reviews, we can launch sooner.”

Musk also said that only about 5% of SpaceX’s resources were devoted to Starship.

In an interview with the Atlantic, Bridenstine said of Musk’s joking on CNN: “Well, I don’t think that’s helpful.”

He was highly doubtful of Musk’s timeline that the first launch with astronauts could occur in three to four months, pointing out recent test failures. SpaceX successfully sent a Crew Dragon capsule, without crew, to the space station in March, but during a subsequent ground test, the capsule was destroyed in an explosion. No one was injured, but SpaceX and NASA had to investigate what happened and fix the problems.

Parachutes have also failed in recent tests. “That’s going to take probably more time to resolve than the launch-abort system,” Bridenstine told the Atlantic.

Bridenstine also said he was not singling out SpaceX: “I’ve been critical of all contractors that overpromise and underdeliver.”

Last week, Bridenstine and Musk provided one consistent story: By the end of the year, there will probably be about 10 drop-tests of an improved parachute design, and the Falcon 9 rocket and Crew Dragon capsule for the crewed flight will arrive in Florida.

The launch itself would await final safety reviews — in the first quarter of next year, if all goes well. “We are not going to take any undue risk,” Bridenstine said.

With Behnken and Hurley also standing next to him Thursday, Musk said, “We’re not going to do anything those two gentlemen are not comfortable with.”

Bridenstine said that his Twitter post about Starship was part of efforts to get contractors to provide realistic budget and schedule estimates.

If delays for SpaceX and Boeing continue past early 2020, NASA will have to consider buying additional seats on Russian Soyuz rockets, which have been the only way that astronauts have been able to get to the International Space Station since 2011.

Some of the turmoil is of NASA’s own making. In July, Bridenstine removed William Gerstenmaier as leader of the agency’s human exploration and operations directorate. Kenneth Bowersox, a former astronaut who was Gerstenmaier’s deputy, is leading that part of NASA on an acting basis, and Bridenstine has yet to announce a permanent replacement.

“That announcement is not months away,” Bridenstine said during the SpaceX visit. “It is weeks away.”

NASA is also trying to accelerate work on its Artemis program to send astronauts back to the moon by 2024.

Bridenstine said he is not opposed to SpaceX working on Starship. “NASA has an interest in seeing Starship be successful,” he said.

He noted that NASA had provided technical help on aerodynamics as well as test facilities for SpaceX to use.

“Thank you to SpaceX for being a great partner,” Bridenstine said at the end of the news conference.

Kenneth Chang is a New York Times writer.