From b9c9bddcfe1e6756fbed635d5d0045d1da9fd3d2 Mon Sep 17 00:00:00 2001 From: SwiftWinds <12981958+SwiftWinds@users.noreply.github.com> Date: Fri, 3 Apr 2026 15:32:50 -0700 Subject: [PATCH] feat: make it not use two user messages in a row --- litellm/responses/compaction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/responses/compaction.py b/litellm/responses/compaction.py index 26c84197467..24e300c1a92 100644 --- a/litellm/responses/compaction.py +++ b/litellm/responses/compaction.py @@ -99,8 +99,8 @@ async def maybe_compact_context( transcript = _serialize_messages_for_summary(messages) summarization_messages: List[Dict[str, Any]] = [ + {"role": "system", "content": SUMMARIZATION_SYSTEM_PROMPT}, {"role": "user", "content": transcript}, - {"role": "user", "content": SUMMARIZATION_SYSTEM_PROMPT}, ] acompletion_kwargs: Dict[str, Any] = {