As the State Legislature staggered blearily toward its summer recess, legislative leaders and Gov . Mario M . Cuomo agreed Saturday on a bill that would make New York the first state to require doctors to counsel pregnant women and new mothers about the benefits of HIV testing.