diff --git a/litellm/llms/chatgpt/responses/transformation.py b/litellm/llms/chatgpt/responses/transformation.py index 638a55452d2..bba058e487b 100644 --- a/litellm/llms/chatgpt/responses/transformation.py +++ b/litellm/llms/chatgpt/responses/transformation.py @@ -141,7 +141,6 @@ class ChatGPTResponsesAPIConfig(OpenAIResponsesAPIConfig): "tools", "tool_choice", "reasoning", - "previous_response_id", "truncation", "text", "max_output_tokens", diff --git a/tests/unit/llms/chatgpt/responses/test_chatgpt_responses_transformation.py b/tests/unit/llms/chatgpt/responses/test_chatgpt_responses_transformation.py index c456e782c09..f108282bed6 100644 --- a/tests/unit/llms/chatgpt/responses/test_chatgpt_responses_transformation.py +++ b/tests/unit/llms/chatgpt/responses/test_chatgpt_responses_transformation.py @@ -218,6 +218,27 @@ class TestChatGPTResponsesAPITransformation: assert "reasoning.encrypted_content" in request["include"] assert request["instructions"].startswith("You are Codex, based on GPT-5.") + def test_chatgpt_omits_foreign_previous_response_id(self): + config = ChatGPTResponsesAPIConfig() + input_items = [ + { + "type": "message", + "role": "user", + "content": [{"type": "input_text", "text": "continue"}], + } + ] + + request = config.transform_responses_api_request( + model="chatgpt/gpt-5.6-sol", + input=input_items, + response_api_optional_request_params={"previous_response_id": "resp_foreign_fixture"}, + litellm_params=GenericLiteLLMParams(), + headers={}, + ) + + assert "previous_response_id" not in request + assert request["input"] == input_items + @pytest.mark.parametrize( "model_name", [ @@ -259,7 +280,7 @@ class TestChatGPTResponsesAPITransformation: assert request["max_output_tokens"] == 123 assert request["truncation"] == "auto" - assert request["previous_response_id"] == "resp_123" + assert "previous_response_id" not in request assert request["reasoning"] == {"effort": "medium"} assert request["tools"] == [{"type": "function", "function": {"name": "hello"}}] assert request["tool_choice"] == {