I think the brief discussion in the online manual is clear as far as it goes: if you have a pact and either of you attacks another player, the pact dissolves.
Sometimes it seems that if you have a pact with TWO AI, only one will come to your aid, which then dissolves all pacts. Other times...