They were not ordered to fight those who sought peaceful relations with them; rather, Allah said:
"But if they turn away, then seize them and kill them wherever you find them, and take none of them as an ally or helper—except those who join a people with whom you have a treaty, or who come to you their hearts shrinking from fighting you or fighting their own people. Had Allah willed, He could have empowered them against you and they would have fought you. So if they withdraw from you, do not fight you, and offer you peace, then Allah gives you no cause against them." (Quran 4:89–90)
Likewise, they were not commanded to fight anyone who concluded a truce with them, even though a truce is a valid but non-binding contract.
Later, in Surat Baraʾa (at-Tawbah), Allah revealed the command to repudiate such covenants, enjoined the believers to fight all the idolaters, and instructed them to fight the People of the Book who refuse to accept Islam until they pay the jizya with their own hands in humbled submission. He did not permit them to abandon fighting these groups—even if the latter sued for peace and proposed an open-ended truce—so long as it remained possible to wage jihad against them.