Infallibility, per classical scholars

Shaykh al-Saduq, in al-I’tiqadat page 96:

Our belief in the prophets, messengers, imams and angels, may God’s blessings be upon them, that they are infallible, purified from every impurity, and that they do not commit a sin, whether small or great, and do not disobey God as He commands them, and do what they are commanded.

And whoever denies them infallibility in any of their conditions, then he is ignorant of them

اعتقادنا في الأنبياء والرسل والأئمة والملائكة صلوات الله عليهم أنهم معصومون مطهرون من كل دنس، وأنهم لا يذنبون ذنبا، لا صغيرا ولاكبيرا، ولا يعصون الله ما أمرهم، ويفعلون ما يؤمرون.

ومن نفي عنهم العصمة في شئ من أحوالهم فقد جهلهم 

Shaykh al-Mufid, in Tashih I’tiqadat al-Imamiyya page 128:

The prophets and the Imams after after them - are infallible during the position of their prophethood or Imams - of all the major and minor sins.

Usage of aql (the mind) leads one to conclude it is is permissible for them (infallibles) to leave a task recommeded to them without intentional shortcomings and disobedience, however, it is not permissible for them to leave an obligatory task.

Except that our Prophet and the imams were safe from leaving the recommended and obligatory tasks - both, before and after, the state of their Imamate.

والأنبياء والأئمة صلوات الله عليهم من بعدهم معصومون في حال نبوتهم وإمامتهم من الكبائر والصغائر كلها، والعقل يجوز عليهم ترك مندوبإليه على غير التعمد للتقصير والعصيان، ولا يجوز عليهم ترك مفترض، إلا أن نبينا صلى الله عليه وآله والأئمة صلوات الله عليهم من بعدهكانوا سالمين من ترك المندوب والمفترض قبل حال إمامتهم عليهم السلام وبعدها

Sayyid al-Murtada:

And we attribute to the prophets and imams, peace be upon them, infallibility without restriction, because (1) they do not do any of the evils as opposed to what the Mu'tazilites say of denying the possibility of infallibles committing major sins, but are not safe from minor sins.

فان قيلأفتقولون فيمن لطف له بما اختار عنده الامتناع من فعل واحد قبيح:

إنه معصوم؟ قلنانقول ذلك مضافا ولا نطلقه، فنقولإنه معصوم من كذا، ولا نطلق فيوهم أنه معصوم من جميع القبائح، ونطلق في الأنبياءوالأئمة عليهم السلام العصمة بلا تقييد، لأنهم (1) لا يفعلون شيئا من القبائح بخلاف ما تقوله المعتزلة من نفي الكبائر عنهم دون الصغائر