A major lingering question was how a compromise might pave the way for passage of legislation to protect the young undocumented immigrants known as Dreamers. Their status is in jeopardy after President Trump moved last year to end an Obama-era program, Deferred Action for Childhood Arrivals, or DACA, that shields them from deportation. Mr. Trump gave Congress until early March to find a resolution to the issue.

For as long as the government is closed, the White House has said it will not entertain demands on immigration. Senators in the bipartisan group proceeded anyway in discussing a compromise in which there would be some kind of promise that the Senate would address the issue in the coming weeks.

“We want to see a commitment to take up immigration,” said Senator Tim Kaine, Democrat of Virginia, “with a belief that we’ll get to a good result for Dreamers.”

Senator Jeff Flake, Republican of Arizona, said it was best for Mr. Trump to let the Senate work out its own solution.