SOMALIA IS an especially vexing object lesson in the difficulties of gearing up American foreign policy to confront the freshly perceived threat of a Soviet reach for the West's oil. Both the United States and the Soviet Union had dabbled earlier in setting up a close political connection with Somalia. Both had come away burned, having found it impossible to mesh their other objectives with Somalia's single and binding obsession: to remove what Somalis call Western Somalia, but what Ethiopians call the province of Ogaden, from Ethiopian control. Only in the heated atmosphere generated by the Soviet invasion of Afghanistan did the Carter administration muster the strategic urgency to set aside its political misgivings and to try to form the Somali connection again.

Post correspondent Edward Cody's stories from the scene indicate that the familiar contradictions have not changed.The Somalis, with some arms left over from Moscow's fling and with others acquired from the conservative anti-communist Arabs, are sponsoring a major secessionist war against Ethiopia's Soviet-equipped, Cuban-assisted, Soviet-advised forces in the Ogaden. In immense number and pitiful condition, the women and children of the Somali fighting men are streaming into refugee camps in Somalia. Desperate for American support, Somalia, in the best of times a miserably poor country, is playing its high card: its (Soviet-built) air and naval facilities. The United States is torn between its eagerness to gain access to those facilities and its reluctance to support Somalia's border-changing war.

Damn the Ethiopians, full speed ahead with the Somalis, even to the point of showing them the United States is tough enough to help them fight their war? Those are the mutters one hears in some corners of Washington. But no one looking only at the bases and their evident strategic utility in the Persian Gulf and Indian Ocean is talking about the real world. The real world centers on that awful war. Refugee aid, economic aid, aid in defensive weapons: all these forms of American assistance are designed, appropriately, to sweeten up President Mohammed Siad Barre without becoming his direct partner in the Ogaden. They are the evidence of an American policy compromise, but in this situation compromise, though uncomfortable, is the prudent policy. The chances for its working may be arguable, but they can only improve if the United States demonstrates that it will not, against its better judgment, be sucked into direct support of a dubious war.