I keep thinking of the October 1962 Cuban missile crisis. This terrifying episode was a very complicated game of diplomatic maneuvering and military posturing, with a thermonuclear exchange between the U.S. and the USSR as the consequence of a misstep.

But that apocalyptic situation had one big advantage over the present one: John Kennedy, Nikita Khrushchev, and Fidel Castro were all sane, rational beings. The same cannot be said about the two protagonists to the Korea crisis, Donald Trump and Kim Jong-un. In Kim, Trump has met his match.

The United States may have the arsenal to deliver on Trump’s threat to bring fire and fury to North Korea, but Kim has a hostage in millions of South Koreans who would be killed before Kim’s weaponry would be neutralized. Even Trump must have some sense of this constraint.

In this game of mutual escalation and bravado, the sane party (God help us) is Chinese President Xi Jinping. The North Korean economy is heavily dependent on China, but so far China has shown no inclination to use its economic leverage to demand that Kim stand down.

China is playing a complex game (far more deftly than Trump) in which its security interests require no fundamental change in the geopolitical status quo on the Korean peninsula—no war and no regime change in the North—and its economic interests call for keeping at bay any serious American retaliation against the Chinese system of economic mercantilism that is doing serious harm to the U.S. economy.

Trump’s top trade official, Robert Lighthizer, is one of his few good appointees. Lighthizer understands China. He served as a hard-line trade negotiator under Reagan, and as a private lawyer who has represented companies undermined by China’s gaming of the trade rules. Lighthizer was set two weeks ago to launch a serious trade complaint against China’s systematic theft of U.S. intellectual property and coercive demands that U.S. companies doing business in China share sensitive proprietary technology.

My sources say that complaint was sidetracked at the last minute so that the administration could seek greater Chinese cooperation on Korea, specifically persuading Beijing to support U.N. sanctions against North Korea. China duly obliged, and the sanctions vote was unanimous—but those sanctions only produced increased threats from Kim.

Now Trump has authorized a weaker version of the same trade complaint. Instead of proceeding with the actual complaint (the plan two weeks ago), the president will request trade officials to determine whether such a complaint should be filed.

This is pretty weak tea. It buys some time, and supposedly puts pressure on Beijing to take a more assertive line with North Korea. If China refuses, the United States can proceed with the complaint.

The problem here is that China holds most of the cards. If China does manage to restrain Kim from his threatened missile launch, Trump would be obliged as part of the deal to indulge China’s harmful trade practices, backing off from any retaliation. Yet the United States would be no better off over the long term with Kim, who will keep expanding his nuclear arsenal.

The situation calls for well-informed and nuanced use of the diplomatic and military resources at America’s disposal—the opposite of Trump’s impulsive bombast. Even if we do everything right, there is still a growing risk of a North Korean nuclear arsenal soon capable of reaching mainland America.

Freezing that arsenal in place would require far more forceful intervention from Beijing than Xi has been prepared to exercise, and Xi would want a lot in return. Kim’s threats to America remain useful to China, because they increase China’s leverage over Washington as the price of Beijing’s aid. China has no reason to restrain Kim too soon, or for too modest a price.

Amazingly, with a nuclear showdown possible this week, the commander-in-chief is not coming home from his vacation, but conducting policy via press comments, phone calls, and tweets in between golf games. You can just imagine JFK retreating to his sailboat.

For all of his nuclear bluster, Trump may find that the price of avoiding a catastrophic war with North Korea is that the United States becomes even more of a client state of China. In the meantime, the risk of two arrogant fools blundering into a nuclear exchange is more serious than at any time since October 1962.