THE SENATE adjourned for its August break on Thursday, closing an unproductive half-year that underscored a fundamental truth about U.S. politics: The country cannot be governed from the fringes. If much is to get done — and there is much to do — compromise must occur.

Republicans’ unilateral effort to repeal Obamacare dominated Congress’s past several months. Even with the GOP holding majorities in both houses, Republican health-care proposals were too cruel and too unpopular, and the procedure congressional leaders used to try to jam them through were too reckless. Only a hard-core base of extreme Obamacare haters wanted Republican lawmakers to proceed. In the Senate, where broad popular opinion is more important than in the heavily gerrymandered House, the repeal effort narrowly failed, and it should have.

Republican leaders face a choice: They can continue trying to force right-wing policy on an unwilling country, or they can work with Democrats to solve problems both parties acknowledge. The path of compromise would diverge sharply from the nasty politics of the recent past. But that is the point: Congress’s recent record is abysmal. Here’s an alternative to-do list.

Following the collapse of repeal-and-replace, Congress will need to stabilize shaky health-care markets. One solid compromise proposal, from the bipartisan Problem Solvers Caucus, is already on the table. Moderate senators are discussing deals of their own. The contours of a fair bargain are clear: a commitment to fully fund Obamacare programs and reinsurance in exchange for some regulatory reforms and added state flexibility.

Also on the must-do-soon list is raising the federal debt ceiling and funding the government — in time to prevent panic that the United States might default on its obligations.

Meantime, Republicans want to turn to tax reform. Good. The U.S. tax code is complex, distortional and internationally uncompetitive. Members of both parties have spoken for years about lowering tax rates, paid for by ending economically inefficient deductions, and bringing home income that U.S. companies have parked overseas. Passing a bill would be easier if Republicans focused on the corporate tax code rather than monkeying with personal tax rates. Democrats should be willing to work with the GOP as long as Republicans make their plan authentically revenue-neutral, not a stealth tax cut.

President Trump ran on a campaign to improve the nation’s infrastructure. Democrats share the goal. They should be open to innovative ways of paying for new roads, rails, wires and ports, including marshaling private funds, if Republicans are willing to raise public money, too.

On foreign affairs, Congress has already made some progress, passing a sanctions bill limiting Mr. Trump’s ability to bargain with Russia, a geopolitical foe for whom the president has a bizarre affection. In reasserting Congress’s prerogatives, lawmakers should also redraft the authorization for the use of military force that provides the legal basis for ongoing military operations against the Islamic State, al-Qaeda and others. Congress has not visited this issue since 2001, and the legal ground for continuing conflict is shaky.

Last week saw the introduction of a couple of immigration bills — but the mainstream, bipartisan compromise looks different, pairing enhanced border protection with a pathway for legal status for people currently in the country.

Finally, lawmakers must stand up for a democratic system under stress. They should stick with their Russia investigation, consider how to harden the nation’s voting procedures against future attack and continue to give special counsel Robert S. Mueller III the support he needs to complete his inquiry.

Republicans can blow off steam, or they can govern. Time to choose.