From e69cbfa56801077fef42f7220ae5172a1d68efbf Mon Sep 17 00:00:00 2001 From: Tsury Date: Wed, 14 Oct 2026 05:29:33 +0300 Subject: [PATCH] fix(serve): preserve explicit false against reasoning defaults --- serve/server.py | 2 +- serve/test_effort_paths.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/serve/server.py b/serve/server.py index ef41da5c..78cf3e46 100644 --- a/serve/server.py +++ b/serve/server.py @@ -3555,7 +3555,7 @@ class Service: if effort: if api == "openai": ctk = req.get("chat_template_kwargs") if isinstance(req.get("chat_template_kwargs"), dict) else {} - if not req.get("reasoning_effort") and not req.get("reasoning") and \ + if req.get("reasoning_effort") in (None, "") and not req.get("reasoning") and \ "enable_thinking" not in ctk and "reasoning_effort" not in ctk: req["reasoning_effort"] = effort elif not req.get("thinking") and not req.get("output_config"): diff --git a/serve/test_effort_paths.py b/serve/test_effort_paths.py index dbc1ae6f..15525f6b 100644 --- a/serve/test_effort_paths.py +++ b/serve/test_effort_paths.py @@ -130,6 +130,7 @@ class EffortPaths(unittest.TestCase): "thinking": {"type": "enabled", "budget_tokens": 20000}}), "xhigh") self.assertEqual(self.level("/v1/responses", {"input": "hello", "reasoning": {"effort": "high"}}), "xhigh") self.assertEqual(self.level("/v1/chat/completions", {"messages": MSG, "reasoning_effort": "none"}), "none") + self.assertEqual(self.level("/v1/chat/completions", {"messages": MSG, "reasoning_effort": False}), "none") def test_the_chat_settings_shared_with_apps_beat_the_config(self): self.svc.config_effort = "low"