Revert "fix(models): reasoning support follows the model, not the route"

This reverts commit 110b40e05a.
This commit is contained in:
Ahmed Allam
2026-09-06 18:02:18 +00:00
parent 110b40e05a
commit f268e1311e
2 changed files with 1 additions and 25 deletions

View File

@@ -837,17 +837,7 @@ def model_supports_reasoning(model_name: str) -> bool:
entry = litellm.model_cost.get(name)
if entry is None and "/" in name:
entry = litellm.model_cost.get(name.rsplit("/", 1)[1])
if entry is not None:
return bool(entry.get("supports_reasoning"))
# Reasoning is a property of the model, not of the route: a model only
# mapped under other providers (``zai/glm-5.3`` for ``openai/glm-5.3``)
# still reasons through an OpenAI-compatible gateway.
bare_name = name.rsplit("/", 1)[-1]
return any(
bool(candidate.get("supports_reasoning"))
for key, candidate in litellm.model_cost.items()
if key.endswith(f"/{bare_name}") and isinstance(candidate, dict)
)
return bool(entry and entry.get("supports_reasoning"))
def is_recommended_or_frontier_model(model_name: str) -> bool:

View File

@@ -12,7 +12,6 @@ from strix.config.models import (
_NonStreamingModel,
_TurnGuardModel,
is_recommended_or_frontier_model,
model_supports_reasoning,
request_timeout_extra_args,
routes_through_litellm,
supports_strict_tool_schemas,
@@ -24,19 +23,6 @@ def test_recommended_models_are_accepted(model_name: str) -> None:
assert is_recommended_or_frontier_model(model_name)
@pytest.mark.parametrize(
"model_name",
["openai/glm-5.3", "glm-5.3", "hosted_vllm/glm-5.3", "openai/kimi-k3", "openai/qwen3.8-max"],
)
def test_reasoning_support_follows_the_model_not_the_route(model_name: str) -> None:
assert model_supports_reasoning(model_name)
def test_reasoning_support_rejects_unknown_models() -> None:
assert not model_supports_reasoning("openai/no-such-model-xyz")
assert not model_supports_reasoning("openai/gpt-4.1")
def test_request_timeout_extra_args_positive() -> None:
assert request_timeout_extra_args(300) == {"timeout": 300}
assert request_timeout_extra_args(10) == {"timeout": 10}