diff --git a/litellm/llms/azure/responses/transformation.py b/litellm/llms/azure/responses/transformation.py index 0dd5e87e4ba..e09867d4351 100644 --- a/litellm/llms/azure/responses/transformation.py +++ b/litellm/llms/azure/responses/transformation.py @@ -22,20 +22,10 @@ else: class AzureOpenAIResponsesAPIConfig(OpenAIResponsesAPIConfig): - # Parameters not supported by Azure Responses API - AZURE_UNSUPPORTED_PARAMS = ["context_management"] - @property def custom_llm_provider(self) -> LlmProviders: return LlmProviders.AZURE - def get_supported_openai_params(self, model: str) -> list: - """ - Azure Responses API does not support context_management (compaction). - """ - base_supported_params: Final = super().get_supported_openai_params(model) - return [param for param in base_supported_params if param not in self.AZURE_UNSUPPORTED_PARAMS] - def validate_environment(self, headers: dict, model: str, litellm_params: GenericLiteLLMParams | None) -> dict: return BaseAzureLLM._base_validate_azure_environment(headers=headers, litellm_params=litellm_params) diff --git a/tests/test_litellm/llms/azure/response/test_azure_transformation.py b/tests/test_litellm/llms/azure/response/test_azure_transformation.py index da44394d11d..d065369a64a 100644 --- a/tests/test_litellm/llms/azure/response/test_azure_transformation.py +++ b/tests/test_litellm/llms/azure/response/test_azure_transformation.py @@ -529,11 +529,17 @@ class TestAzureResponsesAPIConfig: assert "tools" not in response_api_params - def test_azure_responses_api_context_management_unsupported(self): - """Test that context_management is not in Azure supported params. - Azure does not support context_management (compaction). It should be - excluded from supported params so it gets dropped. - """ - supported = self.config.get_supported_openai_params(self.model) - assert "context_management" not in supported +@pytest.mark.serial +def test_azure_responses_api_supports_context_management(): + """Regression for #36391: Azure Responses API documents server-side compaction, + so context_management must be a supported param (not silently dropped).""" + config = AzureOpenAIResponsesAPIConfig() + supported_params = config.get_supported_openai_params("gpt-5.1") + + assert "context_management" in supported_params + + o_series_config = AzureOpenAIOSeriesResponsesAPIConfig() + o_series_supported = o_series_config.get_supported_openai_params("o_series/gpt-o1") + assert "context_management" in o_series_supported + assert "temperature" not in o_series_supported