Senate Republicans and Democrats opened the possibility of a rare bipartisan agreement on a new aid package for Nicaragua's Contra rebels, one that would quiet the controversy as an election-year issue and keep pressure on both sides in Nicaragua to make peace.

"There is an honest effort being made at agreement here," said Sen. John McCain, R-Ariz., who also cautioned that the situation remained fluid and a compromise was far from assured."We're getting very, very close," added Sen. David Boren, D-Okla., an author of the aid package which would continue humanitarian aid to the rebels into 1989 and hold out the possibility of sending weapons if the Managua government misbehaves.

After a day of swapping proposals, the two sides seemed to reach agreement late Thursday on a key element in a possible compromise: a new letter from House Speaker Jim Wright, D-Texas, promising to bring any request from President Reagan for weapons aid for the rebels to a quick vote.

Boren said the letter would include a guarantee that Congress would not adjourn without acting on such a request first, an assurance that would calm the fears of Senate Republicans who are wary of Wright, a Contra aid opponent.

"There's a great deal of suspicion of Jim Wright," McCain said.

Wright made a similar promise as part of an agreement on humanitarian aid for the Contras last March.

Other disagreements remained, however, including a dispute over whether the aid measure would be attached to a Pentagon spending bill - which Republicans said was likely to be vetoed - or to an emergency money measure which was more likely to be signed into law.

McCain said he believed the Democrats badly wanted Republican support for their package.