From c044ec3f6da2ef34ea9c3e7e5998d4f40dc8edee Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 22 May 2026 13:21:19 +0000 Subject: [PATCH] fix(openai-responses): strip cache_control on compact endpoint as well Co-authored-by: Yassin Kortam --- litellm/llms/openai/responses/transformation.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/litellm/llms/openai/responses/transformation.py b/litellm/llms/openai/responses/transformation.py index 5e7a501bf5f..5043d25ee37 100644 --- a/litellm/llms/openai/responses/transformation.py +++ b/litellm/llms/openai/responses/transformation.py @@ -648,6 +648,12 @@ class OpenAIResponsesAPIConfig(BaseResponsesAPIConfig): url = str(parsed_url.copy_with(path=compact_path)) input = self._validate_input_param(input) + tools = response_api_optional_request_params.get("tools") + input, tools = self.remove_cache_control_flag_from_input_and_tools( + model=model, input=input, tools=tools + ) + if tools is not None: + response_api_optional_request_params["tools"] = tools data = dict( ResponsesAPIRequestParams( model=model, input=input, **response_api_optional_request_params