This is in 1.05.
Treaties are supposed to last for a certain length of time, but the AI will ignore this for peace treaties and maybe others. I've seen this in notifications on the left side of the screen where there would be a notification that peace had been made followed by a notification that war was declared. This was in one turn.
It finally happened to me in a game, and I was able to get screenshots and some saves. Here are the screenshots showing this.
Turn 128. The AI asks for peace.
Still turn 128. I agreed, and the AI acknowledges the agreement.
Still turn 128. I check to see if I can declare war on the AI. I can't.
Still turn 128. The AI declares war on me.
Turn 148. Exactly 20 turns later the AI asks for peace. I agreed to it. The AI did not declare war this time.
Turn 167. I check 19 turns later to see if I can declare war. I can't.
Turn 169. I got distracted and didn't check 20 turns later, so I checked 21 turns later. I could declare war if I wanted to.
I guess peace treaties are supposed to last 20 turns, but the AI can ignore this time requirement if it wants to.
I have several saves up to turn 128. The one that shows the problem the best is the one available here. It's at end of turn 127.
Load the save. The Scryve asks for peace. Agree. There is nothing else to do, so go to the next turn. The Scryve declares war at start of next turn.
I have other saves available at the end of turns 125, 126 and 128 if they may be useful.