The U.S. Capitol earlier this month. (Paul J. Richards/AFP/Getty Images)

AN AGREEMENT Tuesday on a bill to help victims of human trafficking may herald a period of unaccustomed productivity in the Senate. The desire of the new Republican majority for legislative accomplishment appears to be aligning with President Obama’s interest in ending his presidency on a constructive note. The winners would be those who want to see Washington doing its job.

“May herald,” we say, because it’s way too soon for celebration. On the contrary: Over the past several weeks, both parties in the Senate have shown they are still more than willing to engage in unfair play, to put politics above principle and to prioritize narrow ideology above the national interest.

The weeks-long logjam over the trafficking bill was wholly unnecessary: A decent compromise was on the table before the Senate’s Easter recess, but Democrats couldn’t bring themselves to say yes. Democrats are vilifying the kind of trade negotiating authority Congress has routinely granted to presidents over the past half-century. Republicans, meanwhile, held as hostage to the trafficking bill the nomination of Loretta Lynch to be attorney general; an outstanding nominee, she has been waiting nearly half a year for a simple confirmation vote. Worse, maybe, is that when the Senate finally considers her, she is likely to barely squeak through because of GOP anger at the president. That’s a perversion of the confirmation system. If agreement with the president on policy disqualifies a nominee, which seems to be the majority GOP position here, he will be awfully lonely in Cabinet meetings.

Still, there are reasons for hope. Lawmakers passed a health-care payment reform this month, ending one of the major, recurring legislative crises that has led to a lot of embarrassing last-minute activity over the years. They did so in large part with their usual bipartisan commitment to widening the deficit, but they did include some useful changes, too. They also relented on ill-considered defense spending caps. Assuming the trafficking compromise holds over the coming days, the Senate finally will vote on, and presumably for, Ms. Lynch, with at least some Republican support. Next up would be two bills with bipartisan parentage: one to provide congressional review of any nuclear weapons agreement the president strikes with Iran, the other to put a trade pact Mr. Obama is concluding with Pacific nations on a fast track for congressional approval. Another bipartisan bill taking shape would reform the No Child Left Behind education law.

Legislators have a long way to go. But in an age in which unbridgeable disagreement has been the norm, green shoots of compromise should be welcomed and nurtured.