From 275e0f40e529ef1e6b581b2beee22640d23568ca Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Wed, 4 Nov 2026 22:43:07 +0100 Subject: [PATCH] fix: context compaction summary cut off at 1000 tokens (#33726) Without Task Model Params set, the compaction summary was capped at 1000 tokens. Reasoning models could spend all of that on thinking and return an empty or cut-off summary, which then replaced the chat's context. The summary request now carries no token limit of its own unless Task Model Params sets one, so the provider's normal limits apply. --- backend/open_webui/utils/context_compaction.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/backend/open_webui/utils/context_compaction.py b/backend/open_webui/utils/context_compaction.py index da2c03c6e4..861a0d4f1c 100644 --- a/backend/open_webui/utils/context_compaction.py +++ b/backend/open_webui/utils/context_compaction.py @@ -458,9 +458,6 @@ async def _generate_summary( if not isinstance(task_model_params, dict): task_model_params = {} task_model_params = {key: value for key, value in task_model_params.items() if value is not None and value != ''} - task_model_params = task_model_params or { - 'max_tokens': models[task_model_id].get('info', {}).get('params', {}).get('max_tokens', 1000) - } metadata = { **(request.state.metadata if hasattr(request.state, 'metadata') else {}),