The Massachusetts Legislature ended formal sessions for the year Thursday with no agreement on a spending bill which would steer money toward the emergency shelter system. The failure to complete a deal means Democrats will need to steer a final bill through informal sessions.