We present improvements on the adaptive optics (AO) correction method using a pyramid wavefront sensor (P-WFS) and introduce a novel approach for closed-loop focus shifting in retinal imaging. The method's efficacy is validated through in vivo adaptive optics optical coherence tomography (AO-OCT) imaging in both, healthy individuals and patients with diabetic retinopathy. In both study groups, a stable focusing on the anterior retinal layers is achieved. We further report on an improvement in AO loop speed that can be used to expand the imaging area of AO-OCT in the slow scanning direction, largely independent of the eye's isoplanatic patch. Our representative AO-OCT data reveal microstructural details of the neurosensory retina such as vessel walls and microglia cells that are visualized in single volume data and over an extended field of view. The excellent performance of the P-WFS based AO-OCT imaging in patients suggests good clinical applicability of this technology.