No one walked away satisfied by the agreement reached late Saturday to raise the debt ceiling: House Speaker Kevin McCarthy did not win the most destructive cuts sought by the right, and the Democratic proposals to raise revenue never seriously entered the conversation. Yet with the risk of ruinous economic default less than a week away, Congress should pass this agreement as quickly as possible.

The agreement reached by Mr. McCarthy and President Biden would suspend the debt ceiling until Jan. 1, 2025. Mr. Biden can, as the nation should, feel relief over this outcome. He also should feel a sense of urgency to make sure such a partisan impasse never repeats itself.

Mr. Biden had said he would not negotiate over the debt ceiling, which limits federal borrowing after money has been appropriated, and he had demanded that Congress raise it without conditions. The House responded by approving a bill to raise the ceiling for a year in exchange for stringent cutbacks on nondefense spending. That bill would have rolled back many of the president’s signature achievements and ended benefits for millions of people who get their health insurance through Medicaid, as well as those who rely on food and cash assistance.

As the deadline for the nation’s first credit default grew closer — the Treasury Department now says it will run out of money on June 5 — Mr. Biden set aside his earlier position and began closed-door negotiations with Mr. McCarthy over those demands.

The final agreement reflects this one-sided bargaining, with Mr. McCarthy refusing to truly entertain any of the Democrats’ proposals to raise revenue: None of the 2017 Trump tax cuts, which added $1.8 trillion to the deficit through 2029 for the benefit of corporations and the wealthy, will be rolled back. Republicans rejected the elimination of the carried-interest loophole, which benefits hedge-fund managers and private equity funds, and the end to fossil fuel tax subsidies that Mr. Biden proposed in his 2024 budget.

In fact, no measures to raise revenues were included; the deal is entirely about cutting spending. Reducing the national debt is an important long-term goal. A much more responsible form of fiscal discipline is to collect the taxes that are owed, to make considered spending cuts where appropriate and to reverse tax cuts that solely benefit the wealthy.

The details of the agreement, released on Sunday, show that it is a watered-down version of the Republican wish list. Spending on most domestic programs in fiscal year 2024 will stay at about the same level as 2023 and grow by 1 percent in 2025. That is effectively a cut over both years, given the pace of inflation and the potential for an economic downturn hovering. (Medicare and Social Security would not be affected.)

Under the deal, the Pentagon would be allowed to grow, as well as veterans’ programs. The two-year cap would shortchange many important investments in education, housing, infrastructure and disease prevention. It is a significant improvement, however, from the drastic cuts proposed in Mr. McCarthy’s bill — $860 billion compared with $3.2 trillion over a decade — and is roughly in line with what might have been expected in regular budget negotiations with the House.

That price was likely inevitable when Democrats lost the chamber last year and failed to raise or eliminate the debt ceiling during the lame duck session.

The White House should have insisted that military and domestic spending be held at the same rate of change, following a pattern set during the Obama administration. At least the military budget in this agreement would be at roughly the same level that Mr. Biden proposed in his 2024 budget. The deal also includes a helpful mechanism that would make it difficult for Republicans to spend less on domestic programs or more on the military when the time comes to write appropriation bills this year.

The most unfortunate aspect of the agreement is the change to eligibility for nutrition assistance, popularly known as food stamps, and the cash welfare program called Temporary Assistance for Needy Families. Though virtually every study has shown that work requirements for these benefits are not effective inducements to employment, Republicans were willing to let the government default on its debt if they didn’t get them. During the talks, Mr. Biden rejected the strict new work requirements for people on Medicaid, but he agreed to changes in the other two programs.

Under this concession, people 50 to 54 years old without dependents would be limited to three months of food stamps every three years unless they meet new work requirements, which the Center on Budget and Policy Priorities said would affect hundreds of thousands of older adults. State requirements for people who receive cash assistance from the TANF program will also be tightened. The only good news here is that, for the first time, the food stamp program would not subject homeless people, veterans or young adults formerly in foster care to time limits, under an agreement won by Mr. Biden.

One of the most nonsensical Republican demands was to cut $80 billion in new funding for the Internal Revenue Service to hire investigators to reduce tax cheating. The I.R.S. expansion would have reduced the budget deficit, according to the Congressional Budget Office, because it would bring in new tax revenue. Republicans refused to reduce the deficits by any means other than cutting spending. Mr. Biden agreed to reduce the new I.R.S. spending by about $21 billion over two years, though the money may be moved to the general fund to reduce the impact of the new spending caps.

The blunt instrument of the debt ceiling allowed this standoff and its concessions. With the Republicans in control of the House, Democrats in Congress have given up their path to change this for now. The president seemed to acknowledge that this month when he told reporters that he’d consider declaring the debt ceiling unconstitutional under the 14th Amendment’s debt clause and letting the courts decide whether he is right. “When we get by this, I’m thinking about taking a look at — months down the road — to see whether, what the court would say about whether or not the — it does work,” he said.

If Congress approves this agreement, the threat of default will be over for the next two years. At that point, Mr. Biden and his legal experts need to follow through on his interest in testing a constitutional solution and try to stop the debt crisis from returning in 2025 or thereafter.