Tafsir Ibn Kathir -> Surah At-Taubah -> Existing Peace Treaties remained valid until the End of Their Term

This is an exception regulating the longest extent of time for those who have a general treaty - with out time mentioned - to four months. They would have four months to travel the lands in search of sanctuary for themselves wherever they wish. Those whose treaty mentioned a specifec limited term, then the longest it would extend was to the point of its agreed upon termination date. Hadiths in this regard preceeded. So anyone who had a treaty with Allah's Messenger , it lasted until its specific termination date. However, those in this category were required to refrain from breaking the terms of the agreement with Muslims and from helping non-Muslims against Muslims. This is the type whose peace agreement with Muslims was carried out to its end. Allah encouraged honoring such peace treaties, saying,

﴿إِنَّ اللَّهَ يُحِبُّ الْمُتَّقِينَ﴾

(Surely, Allah loves those who have Taqwa) ﴿9:4﴾, who keep their promises.

﴿فَإِذَا انسَلَخَ الأَشْهُرُ الْحُرُمُ فَاقْتُلُواْ الْمُشْرِكِينَ حَيْثُ وَجَدتُّمُوهُمْ وَخُذُوهُمْ وَاحْصُرُوهُمْ وَاقْعُدُواْ لَهُمْ كُلَّ مَرْصَدٍ فَإِن تَابُواْ وَأَقَامُواْ الصَّلَوةَ وَءاتَوُاْ الزَّكَوةَ فَخَلُّواْ سَبِيلَهُمْ إِنَّ اللَّهَ غَفُورٌ رَّحِيمٌ ﴾

(5. So when the Sacred Months have passed, then fight the Mushrikin wherever you find them, and capture them and besiege them, and lie in wait for them in each and every ambush. But if they repent and perform the Salah, and give the Zakah, then leave their way free. Verily, Allah is Oft-Forgiving, Most Merciful.)