Repository navigation
Studio: let --no-reasoning-preserve and a custom chat template turn off the Qwen3.8 preserve_thinking default - #15170
Conversation
…ff the Qwen3.8 preserve_thinking launch default llama-server applies --chat-template-kwargs after --[no-]reasoning-preserve, so the preserve_thinking: true Studio pins for Qwen3.8 beat both the flag and a user's chat_template_override. The launch kwarg now follows an explicit --reasoning-preserve / --no-reasoning-preserve (or LLAMA_ARG_REASONING_PRESERVE), and an override falls back to the off default every other family uses. Fixes unslothai#15115
…ts own template renders Forcing the off default broke an override that keeps Qwen3.8's own 'preserve_thinking is undefined or ...' line: it lost history reasoning it kept before. Render the override once with the kwarg omitted and use what it does. [skip ci]
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Fixes #15115
Before: on a Qwen3.8 GGUF, Studio always launched llama-server with
--chat-template-kwargs {"preserve_thinking": true}. llama-server applies that kwarg after--[no-]reasoning-preserve, so passing--no-reasoning-preservethroughllama_extra_argsdid nothing, and a user'schat_template_overridewritten aspreserve_thinking|default(false)was overruled. API clients that can't sendchat_template_kwargsper request re-sent every past turn's reasoning.After:
preserve_thinkingvalue follows an explicit--reasoning-preserve/--no-reasoning-preservein the extra args (last flag wins, as in llama.cpp's parser), else an inheritedLLAMA_ARG_REASONING_PRESERVE.chat_template_overridegets the default its own text renders: Studio renders the override once in a sandboxed Jinja environment withpreserve_thinkingomitted and checks whether an earlier turn's reasoning survives. A copy of Qwen3.8's own template (preserve_thinking is undefined or ...) keeps the on default; a|default(false)template gets off; a template that does not render falls back to off._preserve_thinking_defaultis updated too, so/load,/status, the Studio toggle and the/v1/messagesreplay path report the value the server actually runs with.Testing:
TestThePreserveThinkingLaunchDefaultintests/test_launch_reasoning_flag.pydrives the realload_modelwith a fakedPopen: 13 cases, 9 fail on the merge base and all pass here. Reverting the render step to a plain off default fails the two "override that keeps reasoning stays on" cases.test_launch_reasoning_flag,test_gemma4_chat_template_override,test_external_preserve_thinking,test_anthropic_messages,test_safetensors_capability_advertise,test_llama_thinking_budget,test_managed_engine_reasoning,test_openai_auto_switch): 1738 passed; the 5test_openai_auto_switchMCP cache failures are identical on the merge base.test_launch_reasoning_flag.pyon Linux, macOS (Apple Silicon) and Windows: 97 passed on each./apply-templatewith a historicalreasoning_contentmarker, using the reporter's template: the old launch argv keeps the marker even with--no-reasoning-preserve; the new argv drops it, and--reasoning-preservebrings it back. With Qwen3.8's own template as the override, the marker stays.