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.
This commit is contained in:
mateo-berri 2026-10-29 10:20:33 -07:00
parent f6672a3866
commit 8c36455692
2 changed files with 9 additions and 2 deletions

View file

@ -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(

View file

@ -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},
}
]