From d62199572b817e865ebbf16cdbf487e9faed3a03 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Sun, 8 Nov 2026 11:40:28 +0100 Subject: [PATCH] fix: the turn that compacts the chat still sends the whole history (#33916) When a chat crossed the Context Compaction Threshold, the turn that made the summary still sent the model every earlier message with the summary on top, so that request was larger than without compaction and a chat already over the model's context window kept failing. Now that turn sends the summary and only the recent messages, as 0.13.0 did. Fixes #33915 --- backend/open_webui/utils/tool_permissions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/open_webui/utils/tool_permissions.py b/backend/open_webui/utils/tool_permissions.py index bf9cc169a0..f32524789a 100644 --- a/backend/open_webui/utils/tool_permissions.py +++ b/backend/open_webui/utils/tool_permissions.py @@ -36,7 +36,7 @@ async def get_tool_permissions_auto_config(): def set_tool_approval_prompt(messages, policy=None): - messages = [dict(message) for message in messages] + messages = [dict(message) if message.get('role') in {'system', 'developer'} else message for message in messages] for message in messages: if message.get('role') not in {'system', 'developer'}: continue