The endgame in the trade war between China and the United States seems near. President Trump, betting with real currency — American strength — apparently has the upper hand, and the concessions President Xi Jinping is likely to make won’t be mere tokens. When — if? — an agreement is finally announced, Mr. Trump will surely fire off bragging tweets, partly to shore up his credentials for a second term, amid personal and policy troubles. For Mr. Xi, almost any deal could mean a very serious loss of face.

Mr. Xi assumed power when China was still riding high on its so-called economic miracle (and the United States remained mired in the aftereffects of the 2008-9 recession). He became general secretary of the Chinese Communist Party (C.C.P.) in late 2012 and president of the People’s Republic in early 2013. His anticorruption campaign was instantly popular. He championed the “Chinese Dream,” a vague vision of prosperity, strength and well-being for the country and its people, that seemed to fire up many citizens. His proposal to President Barack Obama to establish a “New Model of Major Country Relations” could only please Han-majority Chinese with imperial yearnings.

But those were easy stunts, performed in a country with no audible opposition and that bans “reckless” talk about the government. The trade war, on the other hand, is the first real occasion to assess Mr. Xi’s leadership capabilities. And his performance might not look so good, even if one discounts the setbacks related to the trade war.

First and foremost, Mr. Xi has utterly failed to manage the United States–Chinese relationship. In contrast, every Chinese leader since the founding of the communist state in 1949 had recognized the paramount importance of those ties, worked hard to improve them — and reaped huge benefits.