fix(deepseek): drop retired models from picker and provider defaults

Stop offering deepseek-chat/reasoner in the static catalog and point
fallback/aux defaults at the permanent v4 IDs. Keep retired aliases in
a detection-only map so /model deepseek-chat still resolves to deepseek.
This commit is contained in:
HexLab98 2026-07-25 12:45:59 +07:00 committed by Teknium
parent cc7c418b33
commit aff48958d3
4 changed files with 60 additions and 36 deletions

View file

@ -1,10 +1,10 @@
"""Unit tests for the DeepSeek provider profile's thinking-mode wiring.
DeepSeek V4 (and the legacy ``deepseek-reasoner``) expects every request to
carry an explicit ``extra_body.thinking`` parameter. Omitting it makes the
server default to thinking-mode ON, which then enforces the
``reasoning_content``-must-be-echoed-back contract on subsequent turns and
breaks the conversation with HTTP 400 (#15700, #17212, #17825).
DeepSeek V4 expects every request to carry an explicit ``extra_body.thinking``
parameter. Omitting it makes the server default to thinking-mode ON, which
then enforces the ``reasoning_content``-must-be-echoed-back contract on
subsequent turns and breaks the conversation with HTTP 400 (#15700, #17212,
#17825).
These tests pin the profile's wire-shape contract so DeepSeek requests stay
correctly shaped without going live.
@ -106,7 +106,7 @@ class TestDeepSeekThinkingWireShape:
class TestDeepSeekModelGating:
"""V4 family + ``deepseek-reasoner`` get thinking; V3 stays untouched."""
"""V4 family gets thinking; V3 / unknown stay untouched."""
@pytest.mark.parametrize(
"model",
@ -114,7 +114,6 @@ class TestDeepSeekModelGating:
"deepseek-v4-pro",
"deepseek-v4-flash",
"deepseek-v4-future-variant",
"deepseek-reasoner",
"DEEPSEEK-V4-PRO", # case-insensitive
],
)
@ -127,7 +126,6 @@ class TestDeepSeekModelGating:
@pytest.mark.parametrize(
"model",
[
"deepseek-chat", # V3 alias
"deepseek-v3-0324", # explicit V3
"deepseek-v3.1", # V3 minor revisions
"", # bare/unknown
@ -168,11 +166,11 @@ class TestDeepSeekFullKwargsIntegration:
assert kwargs["reasoning_effort"] == "high"
assert kwargs["extra_body"] == {"thinking": {"type": "enabled"}}
def test_v3_chat_full_kwargs_omit_thinking(self, deepseek_profile):
def test_v3_full_kwargs_omit_thinking(self, deepseek_profile):
from agent.transports.chat_completions import ChatCompletionsTransport
kwargs = ChatCompletionsTransport().build_kwargs(
model="deepseek-chat",
model="deepseek-v3-0324",
messages=[{"role": "user", "content": "ping"}],
tools=None,
provider_profile=deepseek_profile,
@ -195,12 +193,18 @@ class TestDeepSeekAuxModel:
system.
"""
def test_profile_advertises_deepseek_chat(self, deepseek_profile):
assert deepseek_profile.default_aux_model == "deepseek-chat"
def test_profile_advertises_deepseek_v4_flash(self, deepseek_profile):
assert deepseek_profile.default_aux_model == "deepseek-v4-flash"
def test_consumer_api_returns_deepseek_chat(self):
def test_fallback_models_are_v4_only(self, deepseek_profile):
assert deepseek_profile.fallback_models == (
"deepseek-v4-pro",
"deepseek-v4-flash",
)
def test_consumer_api_returns_deepseek_v4_flash(self):
from agent.auxiliary_client import _get_aux_model_for_provider
assert _get_aux_model_for_provider("deepseek") == "deepseek-chat"
assert _get_aux_model_for_provider("deepseek") == "deepseek-v4-flash"
def test_consumer_api_returns_non_empty(self):
from agent.auxiliary_client import _get_aux_model_for_provider