From e5ffb78224e3f90a4d1d06c83d28883d9e0e9cff Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 22 Jul 2023 16:09:57 -0300 Subject: [PATCH] wip --- aider/history.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/history.py b/aider/history.py index e2441680f..ca45feab8 100644 --- a/aider/history.py +++ b/aider/history.py @@ -33,7 +33,7 @@ class ChatSummary: num = num // 2 # we want the head to end with an assistant msg - if messages[num]["role"] == "assistant": + while messages[num]["role"] == "assistant" and num < len(messages) - 1: num += 1 head = messages[:num]