Beacon Hill was buzzing into the wee hours of Monday morning as lawmakers worked overtime to settle final details on bills to get more clean energy for the state, regulate ride-hailing services, create jobs and financially boost cities and towns.

Of the five major priorities Gov. Charlie Baker and House and Senate leadership agreed should pass at the end of the session, only one, a restriction of noncompete agreements in employment contracts, was left undone by August 1.

"The Senate looked at the last version we had, which we thought was a reasonable version and just ... didn't agree," Rep. John Scibak (D-South Hadley), the lead House negotiator on the bill, told reporters after the late-night session had wrapped up and most lawmakers had left the State House.

Employers use noncompete clauses in contracts to bar employees from working for competitors for a given amount of time.

Both versions of the bill would have restricted the use of noncompete agreements in employment contracts to a year or less to protect workers. The effort was seen as a way to encourage more innovation-sector companies to come to Massachusetts from California, where the practice is already restricted.

House Speaker Robert DeLeo made the bill a priority this year, pushing hard for compromise between business groups and members to deliver a bill that pleased almost everyone. DeLeo's effort paid off when the bill passed the House unanimously.

But no one told the Senate that the bill was supposed to have been pre-approved by all parties already. House and Senate negotiations broke down over the issue of "garden leave," where an employee is terminated but stays on the payroll for a certain amount of time for a lower wage. The practice is typically used in lieu of a full noncompete agreement.

The House wanted garden leaves to be negotiated between employer and employee at the time of hiring. The Senate language preferred the garden leave deal to be made after termination, according to Scibak.

"Obviously there were a number of differences," Scibak said. "If you looked at the bill that passed the Senate and the bill that passed the House, there were differences and it's hard to determine what the sticking point's going to be." 

After a Saturday afternoon Democratic caucus, DeLeo was cautiously optimistic of lawmakers' chances of getting the five remaining major pieces of legislation done before the General Court turned into district-based pumpkins come Aug. 1.

"I hear they are going back and forth with proposals," DeLeo said. "So when I hear that, I'm hopeful that eventually it will get done. Can I promise a yes or a no? I can't do that, but the good part is that, as someone who's been through this a couple of times before, that hopefully that means we'll come to some type of resolution." 

But Senate President Stan Rosenberg called the time-crunch of the drawn-out legislative negotiations "challenging," and he seemed to know which chamber is at fault for the July stalemates.

"The largest and most complicated conference items came to the Senate in the last month after sitting in the House for many many months. That's challenging for us," Rosenberg told reporters Saturday.

Rosenberg said that had lawmakers started on the difficult policy bills earlier in the year, there wouldn't be as much pressure to complete complicated bills like clean energy diversity and ride-hailing regulation at the last minute.

"Energy was promised to us last year, and then in the first quarter of this year, and then in the second quarter of this year," Rosenberg said. "We got it three weeks ago." 

House staff suggested that the conference committees were delayed all the way to the deadline because of complicated additions made by Senators and a lack of organization that is making it difficult to cut compromises.

While they were waiting for the House to pass them some legislation or conference committee reports to adopt, the Senate took up a paid family leave bill Saturday that had been tabled the week before by Minority Leader Bruce Tarr (R-Gloucester). Tarr still wasn't enthusiastic about the chamber's Democrats passing the bill he said had little chance of advancing this session.

Tarr said on the Senate floor that in the final days of formal session that passing the bill would be "a wonderful exercise of saying it would be great to do this."

"We are doing that with a day and a half left in a legislative session, where there's been every indication from the branch down the hall that they will not consider this or many other substantive measures," Tarr said. "... I hope someday we'll have a serious discussion of it. That's not today." 

Asked about Tarr's criticism of the bill's inclusion in the Senate's morning session, Rosenberg blamed lawmaking delays on the current rules structure that gives the House more time to deal with most bills than the Senate.

"What would we be doing this morning if not having discussion and debate on legislation?" Rosenberg asked.

Gun rights activists protested outside the State House for a second straight Saturday, voicing their opposition to Attorney General Maura Healey's recent move to crack down on so-called "copycat" rifles that imitate illegal weapons and skirt the state's assault weapons ban.

Dana McLoud of Wayland told WGBH News outside the State House that Healey had overstepped her boundaries by enforcing the law too broadly.

"Let the vote go on there. Let the Democrats and the Republicans vote on it and let them be the final word and not hers, her interpretation of this law. That's what's wrong," said McLoud, a gun owner who runs a plumbing business in Newton.

"She shouldn't have the right to say that any gun with a magazine, any semiautomatic rifle can't be sold in Massachusetts," McLoud said.

When asked about the Legislature possibly taking action to address the gun law, DeLeo said there was no way lawmakers could manage to debate firearms with only two days left in the session. Instead, DeLeo said he expects a gun-rights organization to take Healey to court to settle the issue of her authority over firearms.

A compromise bill hashed out by House and Senate negotiators that would reform some of the powers and responsibilities of municipalities to give them an easier time with finances and regulations left out language passed in the Senate version that would have allowed cities and towns control over liquor licenses.

Allowing local control of liquor licensing would have allowed the city of Boston to grant and manage where in the city liquor-serving establishments could be located, a key power for targeted economic development.

The language was favored by Boston Mayor Marty Walsh, but the decision by the six-member conference committee to leave the provision out of the final bill means the state will maintain its control over liquor licenses for now.

Both chambers passed the bill Sunday night.

While lawmakers in the House and Senate awaited conference reports settling differences between the chambers on a handful of major bills, the chambers took part in their annual tradition of restoring arts and culture funding cut from the budget by Baker.

As part of his attempt to slash what he saw as unnecessary funding to arrive at a balanced fiscal 2017 budget, Baker vetoed $7.7 million for the Massachusetts Cultural Council, which funds cultural organizations and events around the state.

Most lawmakers are big fans of the cultural council funds that disperse grants and arts support throughout many of their districts

MASSCreative Executive Director Matt Wilson wrote in a statement Sunday night that MCC-funded organizations sustain nearly 33,000 jobs and contribute approximately $36 million in payroll taxes to the state.

"By funding approximately 6,000 projects through the local cultural council network, the MCC financially supports arts and cultural groups in every municipality. It also makes direct grants to approximately 400 nonprofit arts and cultural organizations that, in turn, use these public funds to leverage private dollars," Wilson wrote.

"It supports the tourism industry and helps develop a talented and creative workforce. It also helps us build stronger communities by helping us better understand ourselves and the world in which we live,” Rosenberg said in a statement celebrating the Legislature's reversal of Baker's cut.

The House and Senate easily dispatched a veto from Gov. Baker Saturday, reinstated a bill to expand treatment for Lyme Disease.

The bill would mandate health insurers pay for antibiotic treatment for chronic lyme disease.

Lawmakers had a showdown with Baker last week when the governor vetoed the bill and substituted his own version the narrowed the scope of what medical specialists could recommend antibiotic treatment. Baker and a long list of medical experts argue that antibiotics are an unproven treatment method for Lyme and that insurers should not be held to coverage until the medical community supports it.

Rep. David Linsky from Framingham told WGBH News last week that members understand the importance of the treatment options. Only three members of the House, the top three ranking Republicans, backed Baker's veto.