From 8c36455692ea567dd0219fa39e02468be8ff6a5c Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Thu, 29 Oct 2026 10:20:33 -0700 Subject: [PATCH] fix(lite): keep pi's system role on reasoning model groups pi switches its system prompt to the developer role for any model marked reasoning, so an operator's cache_control_injection_points entry for role system stopped matching on Claude groups. lite pi now sets compat.supportsDeveloperRole false on those entries, so pi sends system as it did before. --- litellm/proxy/client/cli/commands/pi.py | 8 +++++++- tests/unit/proxy/client/cli/test_pi.py | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/litellm/proxy/client/cli/commands/pi.py b/litellm/proxy/client/cli/commands/pi.py index 19c4a94d380..37d485dc1b9 100644 --- a/litellm/proxy/client/cli/commands/pi.py +++ b/litellm/proxy/client/cli/commands/pi.py @@ -193,7 +193,13 @@ def _reasoning_fields(limit: ModelLimits | None) -> Mapping[str, JsonValue]: efforts: Final = limit.supported_reasoning_efforts if limit else None if not efforts: return MappingProxyType({}) - return MappingProxyType({"reasoning": True, "thinkingLevelMap": _thinking_level_map(efforts)}) + return MappingProxyType( + { + "reasoning": True, + "thinkingLevelMap": _thinking_level_map(efforts), + "compat": {"supportsDeveloperRole": False}, + } + ) def _model_entry( diff --git a/tests/unit/proxy/client/cli/test_pi.py b/tests/unit/proxy/client/cli/test_pi.py index ae485914507..f90febb3178 100644 --- a/tests/unit/proxy/client/cli/test_pi.py +++ b/tests/unit/proxy/client/cli/test_pi.py @@ -257,7 +257,7 @@ class TestProviderBlock: ), ], ) - def test_reasoning_efforts_become_pi_thinking_levels(self, efforts, thinking_level_map): + def test_reasoning_efforts_become_pi_thinking_levels_and_keep_the_system_role(self, efforts, thinking_level_map): block = provider_block( "http://localhost:4000", ("m-1",), @@ -270,6 +270,7 @@ class TestProviderBlock: "maxTokens": 8192, "reasoning": True, "thinkingLevelMap": thinking_level_map, + "compat": {"supportsDeveloperRole": False}, } ]