From 4d6f12578de91a14e5e2377807d5459cea145603 Mon Sep 17 00:00:00 2001 From: sinksilk <785976238@qq.com> Date: Thu, 1 Oct 2026 22:15:12 +0800 Subject: [PATCH] fix(proxy): count summary tokens without building a new list Signed-off-by: sinksilk <785976238@qq.com> --- .../pass_through/context_management/editors/compact.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/llms/anthropic/pass_through/context_management/editors/compact.py b/litellm/llms/anthropic/pass_through/context_management/editors/compact.py index 4be645b8f72..81245b4e8b3 100644 --- a/litellm/llms/anthropic/pass_through/context_management/editors/compact.py +++ b/litellm/llms/anthropic/pass_through/context_management/editors/compact.py @@ -1046,7 +1046,7 @@ async def _estimate_summary_input_tokens( try: return await asyncify(litellm.token_counter)( model=summary_model, - messages=list(summary_messages), + messages=summary_messages, ) except Exception as e: verbose_logger.warning(