The Democratic-controlled Senate, nudging the Reagan administration from the right, warned yesterday against cutting off U.S. military aid to Afghan rebels until it is "absolutely clear" that the Soviet Union has ended its occupation of Afghanistan.

The appeal was contained in a "sense of the Senate" resolution approved 77 to 0 after a day of anti-Soviet speeches during which Majority Leader Robert C. Byrd (D-W.Va.) expressed concern that the administration is "going to sell the Afghan resistance down the river."

At issue are U.N.-sponsored peace accords being negotiated in Geneva, under which the United States would be committed to ending its military aid to the rebels 60 days after an agreement is signed and a Soviet withdrawal is under way.

The United States agreed in 1985 to become a "guarantor" of such an accord, and Soviet leader Mikhail Gorbachev offered last month to begin a withdrawal May 15 and complete it within 10 months as long as the accord is signed by March 15 and the United States cuts off its military assistance to the rebels.

In testimony before Congress last week, Robert A. Peck, deputy assistant secretary of state, said the United States "would be prepared, if completely satisfied with the overall agreement, to prohibit U.S. military assistance to the Afghan resistance." He said the United States would expect the Soviets to "show reciprocal restraint under the Geneva accords in stopping its military support for the Kabul regime."

Byrd, joined by several conservative Republicans, sharply challenged Peck's assurances, saying the Senate wants more than words from the Soviets to ensure the withdrawal is completed and the Afghans are free to choose their government.

"How dumb, how silly, how stupid can we be" to rely only on a promise from the Soviets, said Byrd.

Byrd also said he wants to know terms of the agreement before the Senate begins consideration of the new U.S.-Soviet treaty to eliminate intermediate-range nuclear forces, which is currently expected to reach the Senate floor by early May.

"I would like to know what is in this agreement before I call up the INF Treaty," he said. "I hope this administration will let us know what is in the agreement so we can have a full understanding of whether this administration is going to sell the Afghan resistance down the river," Byrd said.

Byrd has said he would resist efforts to link implementation of the treaty to Soviet withdrawal from Afghanistan but appeared to be using his scheduling powers to intensify pressure on the administration to continue U.S. aid to the rebels until a total Soviet withdrawal is guaranteed.

Moreover, sources close to Byrd said he would be prepared to insist on continued congressional funding of the rebels even if there is a U.S.-Soviet agreement to end it under terms that he regards as unsatisfactory. U.S. aid to the rebels amounted to $600 million last year.

In its resolution, cosponsored by leaders of both parties, the Senate expressed its "strong belief" that the United States "should not cease, suspend, diminish or otherwise restrict assistance to the Afghan resistance . . . until it is absolutely clear that the Soviets have terminated their military occupation" and the Afghan rebel force is "well enough equipped to maintain its integrity" during a transition leading to new elections.

It also called for elimination of "all forms" of Soviet aid to the current Kabul regime, urged a "political solution in Kabul acceptable to the {Afghan} resistance" and asserted that "the future of Afghanistan should not be driven by the desire or schedule for a U.S.-Soviet summit."