The White House and congressional leaders, faced with funding cutoffs for critical federal programs, agreed yesterday on a compromise to avert a veto of a wrap-up spending bill for the rest of fiscal 1986.

The spending measure was then approved by the House and sent to the Senate, which was expected to act on it today. However, at least two disputes remain between the Senate and House, involving urban development action grants and reporting requirements for the Internal Revenue Service.

The critical compromise with the White House would allow refinancing of rural electrification loans without penalty, as Congress wanted, but would give the treasury secretary power to veto individual loan arrangements that expose the government to losses considered excessive.

The refinancing plan for financially hard-pressed rural utilities was the last of several issues to be resolved in lengthy negotiations between White House officials and congressional appropriations leaders over the $1.7 billion supplemental money bill for the current fiscal year, which ends Sept. 30.

The measure funds programs ranging from embassy security, an Anglo-Irish aid program and new assistance for the Philippines to space shuttle repair, disaster relief and keeping the Library of Congress reading room open during evenings and weekends.

In some cases, it provides money for programs that, in effect, started going broke this month because of insufficient earlier funding and repeated delays in passing the supposedly "urgent" measure to make up the difference.

Among them are farm price supports and subsidies that were suspended June 3 and home mortgage guarantees that were delayed as of June 6.

In outlining the compromise and urging its passage, House Appropriations Committee Chairman Jamie L. Whitten (D-Miss.) said the threat of a presidential veto had been lifted. "If we keep the bill as it is, it will be signed into law," he said.

To win passage of the measure, the White House had to accept several provisions it earlier protested, including disapproval of $4.9 billion in spending deferrals sought by the administration and a ban on studies that could lead to the sale of Bonneville and other federal power-marketing authorities.

But it succeeded in fending off repeal of the president's general authority to defer spending, which is also under assault in the courts, and pared down the list of new spending ventures, such as extension of trade adjustment assistance to oil and gas workers laid off because of market changes.

The measure, the first such omnibus year-end spending bill passed under the tight fiscal constraints of the Gramm-Rudman-Hollings deficit-reduction law, is fairly modest in comparison with previous wrap-up spending bills. But it nonetheless includes election-year goodies, including earmarked defense research funds for districts of a dozen powerful legislators. It also includes $13 million for Capitol security.

Also yesterday, the House voted 396 to 19 to require that federal retirees receive the full cost-of-living adjustment (COLA) for inflation in 1987. The measure, which the administration opposes, would mandate full COLA payments for civil service, military, foreign service and CIA retirees. The Senate has not taken up the measure.

Rep. Mary Rose Oakar (D-Ohio), sponsor of the bill, said it would ensure equal treatment for federal retirees, who were denied 1986 COLAs because of Gramm-Rudman-Hollings. "If Gramm-Rudman were to continue," she said, "these annuitants may not receive another COLA increase until 1991." Staff writer Judith Havemann contributed to this report.