diff --git a/src/llm_core.py b/src/llm_core.py index dd112cedc..30aff2e47 100644 --- a/src/llm_core.py +++ b/src/llm_core.py @@ -1319,8 +1319,8 @@ _MISTRAL_REASONING_EFFORT = os.getenv("ODYSSEUS_MISTRAL_REASONING_EFFORT", "high # Models that support structured thinking — may output without opening tag _THINKING_MODEL_PATTERNS = ( - "qwen3", "qwq", "deepseek-r1", "deepseek-reasoner", "minimax", - "m2-reap", "gemma", "stepfun", "step-3", "step3", + "qwen3", "qwq", "deepseek-r1", "deepseek-reasoner", "deepseek-v4", + "minimax", "m2-reap", "gemma", "stepfun", "step-3", "step3", "magistral", "mistral-small", "mistral-medium", ) diff --git a/tests/test_llm_core_thinking_models.py b/tests/test_llm_core_thinking_models.py new file mode 100644 index 000000000..4ed4fc3c8 --- /dev/null +++ b/tests/test_llm_core_thinking_models.py @@ -0,0 +1,27 @@ +"""Regression coverage for structured-thinking model detection.""" + +import os + +os.environ.setdefault("DATABASE_URL", "sqlite:///:memory:") + +import pytest + +from src.llm_core import _supports_thinking + + +@pytest.mark.parametrize( + "model", + [ + "deepseek-v4", + "deepseek-v4-flash", + "DeepSeek-V4-Flash", + "deepseek/deepseek-v4-flash", + ], +) +def test_deepseek_v4_models_support_thinking(model): + assert _supports_thinking(model) is True + + +@pytest.mark.parametrize("model", ["deepseek-v3", "deepseek-chat"]) +def test_other_deepseek_models_are_not_promoted_to_thinking(model): + assert _supports_thinking(model) is False