From 13d0a57b4bc1c9ba9fa8ef1c291014b1892d671b Mon Sep 17 00:00:00 2001 From: moe-berri Date: Tue, 15 Sep 2026 15:14:08 -0700 Subject: [PATCH] fix(proxy): keep response ownership markers out of provider requests --- litellm/types/utils.py | 1 + tests/test_litellm/test_utils.py | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/litellm/types/utils.py b/litellm/types/utils.py index 8bab7c349ff..430a30eec21 100644 --- a/litellm/types/utils.py +++ b/litellm/types/utils.py @@ -3778,6 +3778,7 @@ all_litellm_params = ( "aembedding", "allm_passthrough_route", "_litellm_strip_stream_usage", + "_litellm_addressed_response_id", "use_client", "id", "fallbacks", diff --git a/tests/test_litellm/test_utils.py b/tests/test_litellm/test_utils.py index 8bf8489fc52..0aa5d85fd88 100644 --- a/tests/test_litellm/test_utils.py +++ b/tests/test_litellm/test_utils.py @@ -4651,9 +4651,13 @@ def test_aws_bedrock_project_id_excluded_from_bedrock_optional_params(): @pytest.mark.parametrize("filter_name", [ "get_non_default_completion_params", "get_non_default_transcription_params", "filter_out_litellm_params", ]) -def test_scoped_weights_are_excluded_from_provider_params(filter_name: str) -> None: +@pytest.mark.parametrize( + "internal", + [{"_router_weights": {"group": {"deployment": 100}}}, {"_litellm_addressed_response_id": "resp_private"}], +) +def test_internal_metadata_is_excluded_from_provider_params(filter_name: str, internal: dict[str, object]) -> None: filtered = getattr(litellm.utils, filter_name)( - {"provider_option": "kept", "_router_weights": {"group": {"deployment": 100}}} + {"provider_option": "kept", **internal} ) assert filtered == {"provider_option": "kept"}