From 2bddfcbd93e70b1582f353ca234fba8b061c9baf Mon Sep 17 00:00:00 2001 From: dajiaohuang Date: Wed, 7 Oct 2026 14:48:20 +0800 Subject: [PATCH 1/2] Fix Claude models routing to Responses API causing not_found_error (fixes #1369) resolve_api_type() was checking LiteLLM catalog for /v1/responses support but falling through to 'responses' for unknown/new models. Models routed through LiteLLM (non-OpenAI providers like anthropic/*) must always use chat_completions since /v1/responses is OpenAI-specific. Add an explicit routes_through_litellm() check before the catalog lookup. --- strix/config/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/strix/config/models.py b/strix/config/models.py index 4ce6dc86..50d991ff 100644 --- a/strix/config/models.py +++ b/strix/config/models.py @@ -668,10 +668,13 @@ def resolve_api_type(model_name: str, settings: Settings) -> ApiType: An explicit ``STRIX_API_TYPE`` wins. Otherwise the model decides: Responses when LiteLLM's catalog lists ``/v1/responses`` for it, chat completions for - everything else. + everything else. Models routed through LiteLLM (non-OpenAI providers) always + use chat completions because the Responses endpoint is OpenAI-specific. """ if settings.llm.api_type is not None: return settings.llm.api_type + if routes_through_litellm(model_name): + return "chat_completions" if _RESPONSES_ENDPOINT in _catalog_supported_endpoints(model_name): return "responses" return "chat_completions" From f3a3639cac0c33a92a7dabc2085a3a92de7368a1 Mon Sep 17 00:00:00 2001 From: dajiaohuang Date: Thu, 15 Oct 2026 11:34:41 +0800 Subject: [PATCH 2/2] test: cover LiteLLM API type resolution --- tests/test_models.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_models.py b/tests/test_models.py index 82cf8ac4..00d13e04 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -168,6 +168,14 @@ def test_resolve_api_type_follows_the_catalog_not_the_base_url( assert uses_chat_completions_tool_schema(model, settings) is True, model +def test_litellm_models_use_chat_completions_even_when_catalog_lists_responses( + monkeypatch: pytest.MonkeyPatch, +) -> None: + monkeypatch.setattr(models, "_catalog_supported_endpoints", lambda _model: ["/v1/responses"]) + + assert resolve_api_type("anthropic/claude-sonnet-4-5", Settings()) == "chat_completions" + + def test_resolve_api_type_explicit_override_wins(monkeypatch: pytest.MonkeyPatch) -> None: _settings(monkeypatch, "gpt-daybreak-blue-latest", "https://gateway.example/v1") monkeypatch.setenv("STRIX_API_TYPE", "chat_completions")