The Andrews government has reached a deal with energy giant AGL that guarantees its Loy Yang A power station – which supplies about one-third of Victoria’s electricity – can supply the grid with a steady pulse of energy for another 12 years to avoid blackouts.