Fix: set enable_thinking to True for qwen3.8-2.4t-a95b (#18442)

This commit is contained in:
Lynn
2026-08-18 19:27:31 +08:00
committed by GitHub
parent 455d34074e
commit eb4e1aa2a4
2 changed files with 30 additions and 2 deletions

View File

@@ -152,9 +152,10 @@ def _apply_model_family_policies(
# Qwen3 keeps RAGFlow's system default of disabling thinking unless explicitly overridden.
if "qwen3" in model_name_lower:
_pop_thinking_controls()
# -preview variants (e.g. qwen3.8-max-preview) only accept
# -preview variants (e.g. qwen3.8-max-preview) and the flagship
# reasoning model qwen3.8-2.4t-a95b only accept
# enable_thinking=True; the API rejects any other value.
if "-preview" in model_name_lower:
if "-preview" in model_name_lower or "2.4t-a95b" in model_name_lower:
enable_thinking = True
else:
enable_thinking = thinking_type == "enabled" if thinking_type else False

View File

@@ -73,6 +73,33 @@ def test_qwen3_preview_ignores_disabled_thinking():
assert kwargs["extra_body"]["enable_thinking"] is True
def test_qwen3_24t_a95b_forces_thinking_true():
"""qwen3.8-2.4t-a95b (flagship reasoning model) only accepts enable_thinking=True."""
gen_conf, kwargs = _apply_model_family_policies(
"qwen3.8-2.4t-a95b",
backend="base",
gen_conf={},
request_kwargs={},
)
assert gen_conf == {}
assert kwargs["extra_body"]["enable_thinking"] is True
def test_qwen3_24t_a95b_ignores_disabled_thinking():
"""Even with thinking=disabled, qwen3.8-2.4t-a95b still forces enable_thinking=True."""
gen_conf, kwargs = _apply_model_family_policies(
"qwen3.8-2.4t-a95b",
backend="base",
gen_conf={"thinking": "disabled", "temperature": 0.2},
request_kwargs={},
)
assert "thinking" not in gen_conf
assert gen_conf == {"temperature": 0.2}
assert kwargs["extra_body"]["enable_thinking"] is True
@pytest.mark.parametrize(
"provider",
[SupportedLiteLLMProvider.Tongyi_Qianwen, SupportedLiteLLMProvider.Dashscope],