We used to pledge allegiance to the Messenger of Allah ﷺ to listen and obey, and he would say to us, "As far as you are able."
حدثنا علي بن حجر أخبرنا إسمعيل بن جعفر عن عبد الله بن دينار
كنا نبايع رسول الله ﷺ على السمع والطاعة فيقول لنا فيما استطعتم
Muslim also narrated it in al-Imarah, chapter on giving allegiance to hear and obey as much as one is able, no. 1867, from Ali bin Hajar through the same chain.