An American mission to Somalia laid the groundwork for improved relations in the aftermath of the Ethiopian-Somali war, but "a terribly sensitive" issue remains, administration sources acknowledged yesterday.

The special obstacle is the requirement publicly laid down by President Carter on March 9 as a prerequisite for supplying "defensive arms" to Somalia, after its troop withdrawal from Ethiopia's Ogaden region.

Carter said Somalia must provide "a renewed commitment not to dishonor the international boundaries of either Ethiopia or Kenya before we would be willng to discuss with them [the Somalis] economic aid or defensive arms supplies."

Diplomats far beyond the Horn of Africa have been watching to see the direction Somalia will take, after its smashing defeat in the Ogaden by Ethiopian troops reinforced by Cuban troops and Soviet Military advisers.

TR FOR ADD ONE

As American diplomats anticipated, last week's diplomatic mission to Somalia, headed by Assistant Secretary of State for African Affairs Richard M. Moose Jr., found Carter's requirement to be "a terribly sensitive issue" for Somali President Mohammed Siad Barre.

Publicly, the State Department yesterday said the mission headed by Moose produced "significant progress toward agreement on the nature of an expanded relationship between Somalia and the United States."

But the words of that statement were carefully chosen to accentuate the affirmative. Press spokesman John H. Trattner also said no decision was reached on supplying American military aid and he reiterated U.S. concern for the "territorial integrity" of all states in the region.

If the Carter conditions for aiding Somalia are rejected by Siad Barre, some diplomats believe Somalia may be tempted to turn back to the Soviet fold, even though it attributes its defeat in the Ogaden to Soviet and Cuban forces. Somalis claims it "pulverize" the Ethiopians unitl Soviet-Cuban power entered the war.

Cuban President Fidel Castro publicly has held out hope that Somalia, formerly a major recipient of Soviet military aid, may return to the Marxist alignment despite the sting of defeat in the Ogaden.

A Carter administration official said yesterday that the Somalis now "have to figure out which way they want to go." The United States and Somalia, he said, "now both have to sit back and analyze where we stand."

Mosse, in four meetings with Somalia's Siad Barre, was reported to have found him "confident and realistic," showing no sense of alarm despite the great setback in the Ogaden fighting. The Somalis estimate there are a half-million "displaced persons" of Somali origin fleeing across the Ethiopian border to Somalia. The United Nations High Commissioner for Refugees is now attempting to assess the dimensions of the problem.

Moose and Siad Barre discussed possible new American economic aid programs for Somalia beyond the $17 million in surplus food assistance and $4 million in development support which it is now receiving.

Today Moose is scheduled to join President Carter and his party in Brazil, to discuss with them the Horn of Africa situation and other African problems en route to the president's two stops on that continent, Nigeria and Liberia.

Moose met yesterday with the Nigerian embassy charge d'affaires, A.E.H. Emenyi, to try to untagle a dispute over Nigeria's arrest of an American businessman before Carter's arrival in Lagos, Nigeria's capital.

It was unclear, sources said, whether Nigeria will act before Carter's arrival on the imprisonment of American businessman Louis Le-Fevre, 45. He is managing director of the American International Insurance Co. of Nigeria, reportedly involved in a loan-financing dispute, on charges still unspecified.