On other fronts, the governor’s priorities unraveled.

These included her ambitious housing plan, which called for the construction of 800,000 new units over the next decade by allowing the state to override local zoning laws. Lauded by experts who said it would help reverse the state’s housing shortage, the plan faced intractable resistance from lawmakers, forcing Ms. Hochul to back away from it during negotiations.

Lawmakers managed to knock down other divisive ideas, including Ms. Hochul’s proposed tuition hikes for in-state students at city and state universities, a change to the way the state measured emissions, and a ban on the sale of menthol cigarettes that was opposed by Big Tobacco and had divided Black leaders. Lawmakers did agree, however, to raise taxes on cigarettes to $5.35 a pack, up from $4.35.

Ms. Hochul, for her part, managed to fend off proposals that had been championed by Senate and Assembly Democrats, including efforts to increase income taxes on the superrich and a tenant-friendly measure opposed by the real estate industry that would have limited a landlord’s ability to raise rents.

The governor has made crime a cornerstone issue since taking office in 2021, but it took on greater importance after her Republican opponent, Lee Zeldin, seized it to drive his campaign — narrowing Ms. Hochul’s margin of victory to the single digits.

The governor’s changes to the bail laws, which she has repeatedly said were her biggest priority, built upon adjustments she had won last year, when she allowed judges to consider factors like the severity of the crime, and whether or not the accused had access to a gun, when making decisions on whether to hold defendants on bail.

The effect of those changes was limited, because New York law said that judges can use the “least restrictive” means to ensure defendants returned to court. But this year’s proposed changes would, for the first time allow judges to set bail with public safety in mind.

A bright spot for progressive Democrats was the inclusion of two climate measures favored by environmental advocates.

The first will ban the use of natural gas in new buildings beginning at the end of 2025. The ban, which would not apply to current gas stove owners, is seen as a critical step in reducing the state’s dependence on fossil fuels, and meeting emissions-reduction goals. A second measure will allow the New York Power Authority to build and own wind and solar projects to boost clean energy generation.