In a case of diplomatic whiplash, President Donald Trump has gone, in a matter of days, from ridiculing North Korea’s leader, Kim Jong Un, and threatening to destroy his country, to accepting Kim’s invitation for a face-to-face summit in two months, the first ever between leaders of the two countries.

We have long encouraged Trump to pursue negotiations to resolve the danger of North Korea’s nuclear weapons program, rather than threatening war, and the United States should make the most of this opportunity.

And this is the rare time in which he is upending Republican politics in a sensible, not disastrous, way. Talking to our global adversaries, rather than playing tough with them, has been anathema to the party for years.

But the precipitous way in which Trump agreed to the invitation, and the fact that this mercurial president, ill-informed and ill-prepared on complex national security issues, will be across the table from Kim is worrisome.

As proposed under the invitation formally conveyed at a White House meeting on Thursday by South Korean officials who met Kim, Trump would have several weeks to prepare for the meeting.

Kim and his government, with a foreign minister and several vice ministers who are experts on the United States, have been plotting their diplomatic initiatives, including a charm offensive at the Olympics in South Korea and a conciliatory New Year’s speech, for months.

Trump’s administration, meanwhile, has done virtually nothing to prepare for negotiations, having been focused on tightening sanctions against the North and planning for war. There’s been little coordination between the White House and the State Department, which has been gutted and marginalized under Secretary of State Rex Tillerson. What’s more, the chief envoy to North Korea retired last week, and there is no ambassador in South Korea, leaving the administration with few other experts capable of steering the complex portfolio.

The North Koreans have been seeking a summit with an American president for decades, yet Trump agreed to the meeting without getting anything in return.

Many assumed the next step would be preparatory talks in which experts from each side would test the other’s intentions and then enter into lengthy formal negotiations. What happens now is anybody’s guess.