TO READ THE HISTORY of Ronald Reagan is to understand how agonized he must have been by his agreement with China last week on arms sales to Taiwan.

But after a year of searching for alternatives, he correctly concluded that every other possibility was too damaging to U.S. interests. The president deserves strong bipartisan support for making the right choice.

The agreement will not fully satisfy anyone, and there is something in it to offend all parties. But it was probably the best the administration could have extracted from a difficult and dangerous situation.

Yes, by promising to reduce arms sales to Taiwan the president has changed U.S. policy. Not surprisingly, Taiwan is deeply upset. But the technical details of this issue are not as important as they may seem. The important issue is America's overriding strategic interests, and Reagan has correctly perceived them.

It cannot have been pleasant for Reagan to sign a communique that so contradicts his past position on Taiwan, but it was Reagan himself who exacerbated the problem by declaring during the 1980 presidential campaign that he wanted to "upgrade" our relations with Taiwan. Injecting this issue into the campaign had no effect on the election result, but it was a horrible mistake and created an enormous problem when he took office.

Not for the first time had a candidate been overly specific in a foreign policy statement. Jimmy Carter did something similar with his 1976 campaign talk about withdrawing U.S. ground troops from Korea. But presidents, unlike columnists and congressmen, have to live with the consequences of their words. And presidents, unlike the rest of us, are responsible for the national security.

Thus, like Carter with Korea, in the end Reagan had no choice but to back down and look for ways to justify the change, and even to attempt to claim -- as Reagan did to Dan Rather -- that there had been "no change whatsoever." Nothing could have been more painful.

Reagan's oldest supporters feel the greatest sense of betrayal. And the Chinese may continue to protest sales to Taiwan, while every denial of a Taiwan request will rekindle anxiety on the island.

But those are secondary considerations. The important fact is that by signing this communique, President Reagan has preserved the momentum in Sino-American relations.

There are two earlier documents of immense historic importance in Sino-American relations since 1972: the 1972 Shanghai communique, and the 1978 communique that led to mutual recognition .

The Taiwan problem was central in the negotiation of both those documents. In 1972 the two sides agreed to disagree on Taiwan, and to proceed with a limited new relationship. At that time we still insisted on recognizing the authorities on Taiwan as the government of China, but we also said we would "not challenge" the Chinese view that Taiwan was part of China.

In 1978 Carter decided to try to establish full relations, but only if we could still sell "carefully selected defensive weapons" to Taiwan.

The Chinese, realizing that the mutual good of recognition was impossible for the United States in the absence of continuing arms sales to Taiwan, agreed to proceed with recognition while maintaining their position that those arms sales were unacceptable. In fact, arms sales continued throughout 1979 and 1980 at high levels.

Now the Reagan administration has promised to reduce those sales in the future. But this does not represent a fundamental change in the situation. The fact is that Taiwan is not threatened by the mainland, nor is it likely to be for the rest of the century. Taiwan -- secure, prosperous, stable, one of our most important trading partners -- will adjust to this new blow to its pride.

Meanwhile, China has its own hands full with its backward economy, and 45 Soviet divisions sitting on its northern frontier. To take on the Taiwan problem China would require, in the opinion of U.S. military planners, a massive amphibious force that would take years to build -- plenty of time for the U.S. to reinforce Taiwan then, if that improbable event ever comes to pass.The new agreement provides sufficient flexibility to meet Taiwan's legitimate needs. And in any case, as Richard Nixon pointed out recently, Taiwan's security lies in a continuing strong Sino-American relationship which acts as a restraint on Peking.

Reagan has thus reopened the door for great advances in our global position. Had these talks failed, the result would have been a major blow to our world position, with only the Russians -- not even Taiwan -- as the beneficiary.

Through the din of domestic strife in recent years, we have heard repeated calls for a spirit of bipartisanship in foreign policy. But those general pleas often seem to wither when put to a specific test.

This is a case that deserves to pass that test. The debate has raged for years. It is over, at least for the time being. Those who call themselves friends of Taiwan should think of the future, not relive the past searching for scapegoats. One can argue that it could have been done differently, orthat it was a result of careless public language in the past, or that Reagan was "captured" by the State Department or whatever. But all that is irrelevant now.

The point, as I see it, is that after a year of tough negotiations, the two nations have reached a compromise that can allow the further development of common strategic and political interests. This is essential to our national security in the face of Soviet adventurism in southwest Asia and elsewhere. All those who supported Nixon and Kissinger in 1972 and Carter in 1978 should support Reagan in 1982.