Knowing the details of policy helps when cutting a legislative deal in Washington. On Wednesday, Nancy Pelosi and Chuck Schumer left the White House with the outlines of a breathtakingly excellent deal for their party. The key to their victory was knowing more than Donald Trump does about immigration policy. And that same distinction may end up scuttling Wednesday’s compromise.

But, for the moment, the Trump romance with the Democratic leaders seems real. It’s worth being skeptical about how long the affair will last. Trump is mercurial, gets frustrated easily with new negotiating partners, and is not known for keeping his word. But Pelosi and Schumer seem to be exploiting a brief window of opportunity in which two major changes have occurred.

The first is the circumstances at the White House. Steve Bannon, the most important internal agitator pushing for Trump’s hard-line immigration campaign promises, is gone. When Bannon was there, Trump signed an executive order stating that it was his policy to “secure the southern border of the United States through the immediate construction of a physical wall on the southern border, monitored and supported by adequate personnel so as to prevent illegal immigration, drug and human trafficking, and acts of terrorism.” The order was specific, defining the southern border as “the contiguous land border between the United States and Mexico, including all points of entry.” This was followed by a budget request sent to Congress asking for “$2.6 billion in high-priority tactical infrastructure and border security technology, including funding to plan, design, and construct a physical wall along the southern border.” The budget also requested three hundred million dollars for new border agents. The executive order and budget requests remain in place, but Bannon is gone.

John Kelly, the new chief of staff, came from running the Department of Homeland Security, and he has far more nuanced views on immigration, including a deep skepticism of Trump’s wall idea. As I reported earlier this year, Kelly told other Homeland Security officials in July that he has nearly convinced Trump that he doesn’t need a physical barrier on the southern border to prevent illegal crossings.

The second change is that Trump is now genuinely frustrated with Republican leaders after they failed to deliver an Obamacare repeal to him. During remarks on Air Force One on Thursday afternoon, Trump was clear about this.

“I’m a Republican through and through, but I’m also finding that sometimes to get things through, it’s not working that way,” he said. “And, you know, we got very poorly treated on the health-care plan, and now you see what’s happening where people are going single-payer—exactly what I said would happen. And single-payer would be a terrible thing for our country. So my relationship with the Republicans is excellent. Many of them agree with what I’m doing.” He added, “But we have to get things passed, and if we can’t get things passed, then we have to go a different route. We have to get things passed.” This is the clearest statement Trump has made that his deals with Schumer and Pelosi are actually part of a change in strategy rather than being completely at random. As much as one can read anything into Trump’s behavior, this seems to suggest that the Schumer-Pelosi romance comes out of frustration with Paul Ryan and Mitch McConnell.

Schumer suggested something similar on Thursday when he said, in remarks that were captured by a microphone, that he and Trump have developed a friendly tactical alliance. “He likes us,” Schumer said, before realizing that Trump may not actually like Pelosi. “He likes me, anyway.” He explained, “Here’s what I told him: ‘Mr. President, you’re much better off if you do one step right, and one step left. If you just step in one direction, you’re boxed.’ He gets that.”

Schumer and Pelosi went into the dinner on Wednesday with a plan. Trump’s views on immigration are a little more nuanced that he is sometimes given credit for. The wall was a campaign rallying cry, but kicking out immigrants protected by DACA was not. Trump did at one point say that DACA protectees would have to leave the country, but he also frequently suggested that he would not prioritize their deportation and would find a solution. To immigration hard-liners, including Jeff Sessions, the Attorney General, Trump’s recent decision to end DACA meant that these immigrants would be deported. But Trump has undercut Sessions and others by asking Congress to come up with a legislative solution.

Schumer and Pelosi took him seriously. At the dinner, they specifically offered passage of the DREAM Act, the main legislation in Congress to protect people who were brought to the U.S. illegally as children and through no fault of their own, as part of a deal. The legislation includes a pathway to citizenship for Dreamers. When Trump requested border security as the price for the DREAM Act, Schumer and Pelosi pointed to the parts of his budget request that were outside the wall and the border agents—in essence to the “high-priority tactical infrastructure and border security technology” that included a long list of security measures that have been part of bipartisan immigration deals for years. Trump agreed.

“Leaving the dinner, there was no confusion about what was on the table,” a senior Democratic official said. “Today the White House and the President and his allies have tried to describe the outline of the agreement in a way that minimizes the anger the base feels. But there was no confusion about it. The Democrats didn’t leave the dinner thinking he was going to end fighting for the wall, and he made it clear the wall is later and he wants to deal with DACA first.”

Trump said as much on Thursday. “The wall will come later,” he said, before leaving the White House for a trip to Florida. But he seemed confused about what was in the DREAM Act. Later in the day, he told reporters, “No, we’re not looking at citizenship. We’re not looking at amnesty. We’re looking at allowing people to stay here.” That statement represents a major disconnect between Trump and the Democrats, and one that could scuttle the fragile plan. If Trump does end up signing the DREAM Act, it would be the most progressive change to immigration laws since Reagan’s mass amnesty, in 1986. No wonder Trump’s base is freaking out.