Did the United States make a mistake when it agreed to pull out of the Panama Canal by the end of this century?

There's room for wondering in view of this week's abortive coup in Panama, a coup that was put down only by the use of American troops left over from the U.S. incursion nearly a year ago that resulted in the capture of Gen. Manuel Noriega.The uprising led by former Col. Eduardo Herrera proved that Panama's police force is still unwilling or unable to quell an internal rebellion. That should not be surprising since the police are largely holdovers from corrupt days of the Noriega regime and often have little training in police work.

Although the uprising was brief and resulted in only one death, it should prompt the 12,000 troops still in Panama to back off from previous plans to return to their bases by Dec. 20, the first anniversary of the U.S. incursion that ousted Noriega.

This week's incident also should prompt an examination of whether or not Panama really needs an army. Already, some Panamanians themselves are suggesting that their country adopt the model of Costa Rica and go without an army.

Another disturbing question raised by the rebellion is whether or not Panama can live up to its part of the 1978 treaty by which it takes full control of the Panama Canal at the end of the century.

The treaty is based on the understanding that Panama will maintain a democratic government and keep on friendly terms with the United States. But how firm can such assurances be with the constant threat of coups in Panama?

The Panama Canal is still vital to America's national interest. Because the canal cuts more than 6,000 miles and two to three weeks from a voyage between the Atlantic and Pacific oceans, this waterway remains critical to American trade and defense.

It's much too soon to think seriously about trying to abrogate the Panama Canal treaty. But it's certainly not too soon to start working on ways to make sure the government of Panama remains free and friendly.