From f85ca2d502bf4fa620341adae6dba4d65393cdb1 Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Mon, 25 May 2026 18:20:39 +0530 Subject: [PATCH] fix(anthropic/messages): check per-request drop_params alongside global Co-authored-by: Cursor --- .../anthropic/experimental_pass_through/messages/handler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/litellm/llms/anthropic/experimental_pass_through/messages/handler.py b/litellm/llms/anthropic/experimental_pass_through/messages/handler.py index c767cc6bb45..b4109a48106 100644 --- a/litellm/llms/anthropic/experimental_pass_through/messages/handler.py +++ b/litellm/llms/anthropic/experimental_pass_through/messages/handler.py @@ -461,8 +461,9 @@ def anthropic_messages_handler( # In-gateway context_management polyfill on the chat-completions adapter # (native on Anthropic/Responses paths). Skipped when drop_params is on. context_management_spec = _shared_kwargs.pop("context_management", None) + _drop_params = _shared_kwargs.pop("drop_params", None) or litellm.drop_params polyfill_applied_edits: List[AppliedEdit] = [] - if context_management_spec and not litellm.drop_params: + if context_management_spec and not _drop_params: from litellm.llms.anthropic.experimental_pass_through.context_management import ( apply_context_management, )