Disclosed is an apparatus for treating a respiratory disorder in a patient. The apparatus comprises a pressure generator configured to deliver a flow of air at positive pressure to an airway of the patient through a patient interface, a sensor configured to generate a signal representative of respiratory flow rate of the patient, and a controller. The controller is configured to control the pressure generator to deliver ventilation therapy having a base pressure and a pressure support through the patient interface, detect an apnea from the signal representative of respiratory flow rate of the patient, control the pressure generator to deliver one or more probe breaths to the patient during the apnea, determine patency of the patient's airway from a waveform of the respiratory flow rate signal in response to one of the one or more probe breaths, compute an effective duration of the apnea based on the patency of the airway, and adjust a set point for the base pressure of the ventilation therapy in response to the apnea based on the effective duration of the apnea.