President Trump, left, greets Canadian Prime Minister Justin Trudeau. (Carlos Barria/Reuters)

PRESIDENT TRUMP’S moods about trade continue to swing. He went out of his way to bash the five-year-old free-trade deal between the United States and South Korea, irritating that ally at precisely the same time he needs Seoul’s cooperation against North Korea. On the other hand, Mr. Trump decided not to withdraw from the North American Free Trade Agreement, partly because the leaders of Canada and Mexico asked him politely not to, and partly because, as he put it, such an announcement would have been a “pretty big, you know, shock to the system.” Instead of shredding the 23-year-old pact, Mr. Trump will renegotiate it. Thank heaven for small favors — though in fact the administration had already telegraphed this pragmatic departure from the president’s strident anti-NAFTA campaign rhetoric a month ago, in the form of a leaked draft letter to Congress setting out a (relatively moderate) agenda for trade talks with our northern and southern neighbors.

A statement of intent to leave NAFTA would indeed have disrupted settled expectations upon which depend hundreds of billions of dollars in investment and millions of jobs. In bowing to that reality, Mr. Trump tacitly concedes the tariff-slashing pact is not the “disaster” he repeatedly claimed, but something we cannot easily do without. In fact, it has been a generally, if modestly, positive force for growth and modernization in the U.S., Mexican and Canadian economies, whose diffuse benefits to Americans, in terms of expanded exports and lower prices for a wider range of goods, have been offset locally by job losses and other concentrated costs.

As for renegotiating it, the Obama administration actually included some tweaks to trade relations with Canada and Mexico in the Trans- Pacific Partnership, which Mr. Trump abandoned before it could take effect, calling it even worse than NAFTA. For example, the TPP would have allowed U.S. dairy exports into Canada’s notoriously protected market — precisely the issue that caused Mr. Trump (and Democrats from dairy states, too) to lash out at Canada this month. A new NAFTA negotiation might also be the opportunity finally to settle long-running, if mostly overblown, U.S. lumber industry complaints over Canadian imports, which Mr. Trump has also embraced of late.

Beyond reinventing that particular wheel, Mr. Trump’s negotiators may also focus on the domestic-content rules governing the automotive industry in North America. Small and inefficient at the time of NAFTA’s signing, Mexico’s booming car-assembly factories now supply 30 percent of all U.S. auto imports. Autos and auto parts sold tariff-free within the NAFTA area must be at least 60 percent made in the United States, Canada or Mexico, according to the agreement. But that norm could usefully be tightened, both as a policy matter and as the political price of greater U.S. support for the pact overall.

What decades-old relationship couldn’t benefit from a bit of a tune-up? If that’s all Mr. Trump has in mind for NAFTA, after all his huffing and puffing — if his newfound pragmatism is for real — then Canada and Mexico can and should be willing to engage. If his change of attitude is just temporary, however, no amount of good faith from our partners can salvage hemispheric free trade.