Skip to content

Commit 007e2c8

Browse files
committed
test(frontend): cover deepseek-v3/v4 thinking opt-in
Add a direct unit test for resolve_request_force_reasoning asserting that deepseek-v3 and deepseek-v4 both opt into reasoning via chat_template_kwargs.thinking and stay off by default. The behavior already lives in main (deepseek-v4 in _THINKING_OPT_IN); this adds the focused default-off assertion that ai-dynamo#10163 carried, as a test-only change. Signed-off-by: Gavin.Zhu <gavin.z@gmicloud.ai>
1 parent ac05d48 commit 007e2c8

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

components/src/dynamo/frontend/tests/test_sglang_processor_unit.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,27 @@ def test_minimax_m3_force_reasoning_uses_thinking_mode():
632632
)
633633

634634

635+
@pytest.mark.parametrize("parser_name", ["deepseek-v3", "deepseek-v4"])
636+
def test_deepseek_v3_v4_thinking_opt_in(parser_name):
637+
"""deepseek-v3/v4 opt into reasoning via chat_template_kwargs.thinking.
638+
639+
deepseek-v4 maps to the same _DeepSeekV3Detector as deepseek-v3 in sglang,
640+
so both honor the ``thinking`` kwarg and stay off by default.
641+
"""
642+
assert (
643+
resolve_request_force_reasoning(
644+
{"chat_template_kwargs": {"thinking": True}},
645+
parser_name,
646+
template_default=False,
647+
)
648+
is True
649+
)
650+
assert (
651+
resolve_request_force_reasoning({}, parser_name, template_default=False)
652+
is False
653+
)
654+
655+
635656
class _CapturingReasoningParser:
636657
def __init__(self, *, model_type, stream_reasoning, force_reasoning):
637658
self.model_type = model_type

0 commit comments

Comments
 (0)