On Thursday, as Congress started voting on an omnibus spending bill to keep the government open through the end of September, White House officials assured the press that President Donald Trump would sign it. On Friday, Trump tweeted that he had other ideas.

I am considering a VETO of the Omnibus Spending Bill based on the fact that the 800,000 plus DACA recipients have been totally abandoned by the Democrats (not even mentioned in Bill) and the BORDER WALL, which is desperately needed for our National Defense, is not fully funded. — Donald J. Trump (@realDonaldTrump) March 23, 2018

Trump’s rage isn’t unjustified, considering that the omnibus bill gives the president very little of what he asked for on immigration enforcement — arguably his top domestic policy priority. Not only does it not give him the billions of dollars the White House wants for a “big, beautiful wall,” or contain restrictions on funding for “sanctuary cities,” but Congress is actually making an effort to rein in the Trump administration’s overspending on immigration detention instead of expanding it.

But it’s still a shock — not only because the administration was praising the omnibus yesterday for reasons including its wall funding, but because Trump never made it clear that some sort of protection for the 690,000 unauthorized immigrants facing the loss of their work permits through the Deferred Action for Childhood Arrivals (DACA) program was a condition for his signature.

This is the point. The spending deal makes clear that the White House’s current approach to immigration in Congress simply isn’t working. And the angrier Trump gets, the clearer it gets that it’s impossible for Republicans in Congress to predict what Trump wants.

Congress is willing to fund border barriers — just not the ones Trump wants

Trump appears to be upset that Congress isn’t giving the president the $25 billion the White House says it will take to fulfill its plan to build several hundred miles of barriers along the US/Mexico border. While his White House rejected a deal in February to pay that much for the wall in exchange for allowing DACA recipients to become legal immigrants and ultimately citizens, the idea of the “wall for DACA” appears to have stuck in the president’s brain.

Over the last few days, the White House and Republicans reportedly offered a couple of proposals to fund the wall at that level (or at least for a few years) in exchange for three more years of temporary protections for DACA recipients, with no indication of what would happen to DACA recipients at the end of that time. Democrats rejected that deal — given that a court order currently allows DACA recipients to renew their protections for another two years, a three-year extension doesn’t mean all that much. But that apparently infuriated Trump so badly that he’s threatening a veto.

The irony is that Trump’s own White House was bragging, as late as Thursday, that the bill offers more money to build the wall than the administration actually asked for.

This bill is technically for the rest of the current fiscal year — the one that expires on September 30. And Congress is actually giving the administration $1.375 billion of the $1.6 billion it requested for border barriers last May, in its budget request for the current fiscal year — even if the omnibus bill insists on calling it “fencing” rather than a wall.

They’re appropriating $445 million for 25 miles of levee fencing in the Rio Grande Valley (and another $196 million for an unspecified amount of regular pedestrian fencing there); $251 million to replace 14 miles of existing secondary fencing in the San Diego sector; and $445 million to replace an unspecified amount more of pedestrian fencing. (If you’re curious about the difference between primary and secondary fencing, check out our border wall explainer.)

Speaker Paul Ryan and other Republicans have insisted that the bill funds the wall. As policy, they’re right — there’s no reason that President Trump couldn’t take credit for building a few dozen miles of fencing as “continuing to build the wall.”

But, crucially, the bill specifically prevents the Trump administration from using any of the new wall designs it commissioned and tested in California last year. All money has to be spent on “operationally effective designs deployed as of the date of the Consolidated Appropriations Act, 2017” — a bill Trump signed on May 5, 2017.

If President Trump cared less about his wall than about a wall, this wouldn’t be an issue. But everything we know about the president indicates that’s not the case, and that this is a blow to his ego — he reportedly upbraided congressional Republicans this week for not supporting it, claiming they “owed” him for his support for the tax bill and his nomination of Neil Gorsuch to the Supreme Court. The bullying tactics do not appear to have worked.

There is one really big restriction on immigration enforcement in the omnibus — and Trump isn’t paying any attention to it

Trump’s fixation on the wall has kind of obscured something that has an objectively bigger impact on immigration policy — namely, the amount of money being given to Immigration and Customs Enforcement (ICE) to expand interior immigration enforcement and deportations.

This is an area where congressional Republicans might be expected to fight harder for the administration than a mostly symbolic wall. But they’re not — or, at least, they weren’t willing to risk a shutdown over it.

Trump wanted 1,000 new ICE agents; he’s getting barely 100, and none of them are the field agents responsible for arresting unauthorized immigrants. (Instead, ICE is getting more staff for investigations and mission support.)

And when it comes to immigration detention, Congress isn’t just refusing to give the White House the 20 percent increase in detention Trump asked for — it’s rebuking ICE for overspending and expecting Congress to bail it out.

Under the last budget, ICE was given enough money to keep 39,324 immigrants in detention at any given time. They’ve been overshooting that cap by more than 1,000 immigrants a day. To cover the increased costs, they’ve been shifting money from other areas — something the administration is allowed to do up to a certain point — and asking for supplemental funding from Congress as, essentially, a reimbursement.

As the explanatory text for the omnibus shows, Congress is not pleased:

Between October 1, 2017, and the date of enactment of this Act, when the Department was operating under the terms of a continuing resolution (CR), ICE exceeded its annualized rate of funding for Custody Operations. During the period of any future CR, including any CR for fiscal year 2019, ICE is directed to manage its resources in a way that ensures it will not exceed the annualized rate of funding for the fiscal year. ICE is directed to update the Committees weekly on its rate of operations for Custody Operations to demonstrate how the agency is living within its means.

The omnibus gives ICE money to keep an average of 40,520 immigrants in detention on any given day. In order to meet that target (and “live within their means”), they’ll have to start detaining fewer immigrants than that by the end of the fiscal year.

Compared to what Congress authorized last year, this is still an expansion of detention. But the Trump administration didn’t actually take that authorization seriously. And instead of responding by giving ICE the money it needs to keep holding more immigrants, Congress is reminding ICE who holds the purse strings.

Trump’s real problem on immigration in Congress isn’t Democrats. It’s Republicans.

To a certain extent, this probably reflects Democrats’ renewed attention to limiting funding for Trump’s immigration agenda, especially in the absence of passing any bills that would legalize any unauthorized immigrants. But the White House’s real problem isn’t that Democrats are using their leverage to restrict immigration enforcement money — it’s that congressional Republican leadership isn’t willing to put up a fight (and risk a shutdown) to give the White House what it wants.

The veto threat kind of proves them right. The Trump White House offered no indication — public or, apparently, private — that protections for DACA recipients were an essential provision in the spending bill. (If they had, Democrats would have had a lot more leverage in demanding their inclusion.) Given that Trump also threatened to veto several DACA deals in the last few months, there was every reason to believe this wasn’t a priority for the president except as far as he could get his other immigration priorities (like legal immigration restrictions) passed.

As Vox’s Tara Golshan has reported, the White House made a belated effort to insist on using the omnibus to target sanctuary cities. But that isn’t, apparently, what Trump is angry about. If congressional leaders had buckled to that demand, they’d be in exactly the same position now — facing a veto threat over something wholly unanticipated.

Congress really doesn’t like it when the executive branch treats it this high-handedly. And the Trump administration takes the same approach to carrying out immigration enforcement right now — its “detain now, fund later” strategy. In both cases, the executive branch is expecting Congress to validate anything they think is important — rather than working with them in advance to get a good deal.

It’s no wonder that all this has convinced a lot of Republicans in Congress that the White House isn’t negotiating with them in good faith on immigration.

Congressional Republicans wrote the omnibus bill the way they did because they didn’t seem that interested in trying to guess what the president will actually sign. The president, by threatening a veto over a provision he’d never demanded and a provision that his own officials were bragging about success in getting, is proving them exactly right.