Repository navigation
server: an explicit thinking off that a template can't honour is refused - #2170
Conversation
Carry client origin from OpenAI parsing into prompt preparation. Internal compaction notes and Living Weights asks retain the existing prompt policy, while client chat, completion and translated requests keep the explicit-off check. The host regressions fail for compaction, ask and askIn before the change and pass afterwards alongside the existing client refusal and prompt-ID checks. Refs #2139, #2170.
Read the selected model capability once and omit the off field only when it is explicitly unsupported. Unknown servers retain the existing request and are labelled unverified. Server-default samples carry a local-only settings marker, remain custom protocol cells and are refused by publication validation. Host tests cover request bytes, bounded model discovery and the local save/publication boundary. Refs #2139, #2170.
Unknown discovery keeps the legacy off request and labels it off requested (unverified). Only an explicit unsupported switch selects the model default. Both clients can compare a prior receipt and flag rows with different thinking labels, including per-request modes in mixed runs. Host-only request and CLI tests cover both paths and matching-label controls. Refs #2139, #2170.
Expose thinking applicability from the model's close token, separately from whether its renderer has an off switch. Native and Python clients omit the off field and label such models not applicable. Preserve the established gpu-chat-no-think prompt name and compare receipts using their mode labels. Pin discovery and request behavior for no-thinking models, refresh only the new model-listing field and HTTP length, and account for the native client's single discovery GET in its end-to-end tests. Refs #2139, #2170.
|
GB10 run, main against this head, Qwen3.8-27B: verdict GREEN. No token differences across runs in the 20 prompt rows I checked. 32K prompts read -0.1 to +0.2%, decode after them 0 to +0.3%, and the 1- and 4-stream chat and code sweeps -0.3 to +0.2%. A level result is what this change should give, since it only refuses a request earlier. The branch now conflicts with main, so it needs a rebase before it can land, and it still owes the thinking-off reply on GLM and LFM2. |
e6bb8ee to
9da1f70
Compare
|
Rebased onto today's main (
Neither template reads a named off switch, and both are served as on main. Only a template with neither a switch nor a closable generation prefix is refused, with The host tests pin both checkpoints' own templates (unmodified, recorded in |
e6fc9d2 to
7d078c1
Compare
|
Rebased onto main (
The thinking and discovery host steps pass on the rebased head: 23 of 23 steps, 190 tests. |
|
Held until after the 1.2.4 cut. #2157 landed tonight and gives each |
…sed, on main's capability source (#2170) #2170 (its commits c66c50e, d9a6676, e6daa05 and 7d078c1) brought onto main 221aca5 with the two held conflicts resolved: - #2157's one capability source: thinking_switch and thinking_applicable are Info flags and the last two Capability entries, so /v1/models keeps one capabilities object with its fields and order and appends the two; the server sets them once at start-up (the off probe renders through the same refusal as a request) and an idle reload keeps them; the request refusal reads applicability through Info.capability. - main's DeepSeek native path in prompt.zig is kept as is: its encoder has a real switch (the synthetic source names enable_thinking and thinking_mode) and writes <|Assistant|></think> itself, so it is never refused. Tests beyond #2170's: raw completions, a switched template whose off render ends without </think>, DeepSeek off through the OpenAI route, the listing shape and the reload. The 17 /v1/models goldens gain only the two fields and their Content-Length. Part of #2139.
|
Reworked onto today's main as two commits (
Server suites, |
7d078c1 to
eed5bdd
Compare
…ges default (#2170) /v1/messages fills a missing `thinking` in as disabled and writes enable_thinking false and reasoning_effort none for the template. #2170's refusal read those fields as the client's own off, so a Messages request that left thinking out got HTTP 400 on a template with a one-token </think> and no switch or closable prefix, where main served it with 200. #2170's original commits had the same path. The translator now reports whether the client sent `thinking`; Messages passes that to runNamed, plan sets chat.Input.explicit_off only for an off among the client's own fields, and the prompt refuses only then. The kwargs are unchanged, so every rendered prompt keeps its ids. count_tokens follows the same rule: it refuses the bodies /v1/messages refuses and otherwise counts the prompt it submits. Chat, completions and Responses bodies are the client's own; --no-thinking and template defaults never reach those fields. Tests: Messages without thinking (switchless, always-closed and dangling templates, both server defaults) is served with main's ids and counted the same; its own disabled is refused on both routes and honoured by a switch; Responses without reasoning is served under either default, and its effort none is refused. Part of #2139.
…sed, on main's capability source (#2170) main 221aca5 with the two held conflicts resolved: - #2157's one capability source: thinking_switch and thinking_applicable are Info flags and the last two Capability entries, so /v1/models keeps one capabilities object with its fields and order and appends the two; the server sets them once at start-up (the off probe renders through the same refusal as a request) and an idle reload keeps them; the request refusal reads applicability through Info.capability. - main's DeepSeek native path in prompt.zig is kept as is: its encoder has a real switch (the synthetic source names enable_thinking and thinking_mode) and writes <|Assistant|></think> itself, so it is never refused. Tests beyond #2170's: raw completions, a switched template whose off render ends without </think>, DeepSeek off through the OpenAI route, the listing shape and the reload. The 17 /v1/models goldens gain only the two fields and their Content-Length. Part of #2139.
…ges default (#2170) /v1/messages fills a missing `thinking` in as disabled and writes enable_thinking false and reasoning_effort none for the template. #2170's refusal read those fields as the client's own off, so a Messages request that left thinking out got HTTP 400 on a template with a one-token </think> and no switch or closable prefix, where main served it with 200. #2170's original commits had the same path. The translator now reports whether the client sent `thinking`; Messages passes that to runNamed, plan sets chat.Input.explicit_off only for an off among the client's own fields, and the prompt refuses only then. The kwargs are unchanged, so every rendered prompt keeps its ids. count_tokens follows the same rule: it refuses the bodies /v1/messages refuses and otherwise counts the prompt it submits. Chat, completions and Responses bodies are the client's own; --no-thinking and template defaults never reach those fields. Tests: Messages without thinking (switchless, always-closed and dangling templates, both server defaults) is served with main's ids and counted the same; its own disabled is refused on both routes and honoured by a switch; Responses without reasoning is served under either default, and its effort none is refused. Part of #2139.
eed5bdd to
e4e6849
Compare
…sed, on main's capability source (#2170) main 221aca5 with the two held conflicts resolved: - #2157's one capability source: thinking_switch and thinking_applicable are Info flags and the last two Capability entries, so /v1/models keeps one capabilities object with its fields and order and appends the two; the server sets them once at start-up (the off probe renders through the same refusal as a request) and an idle reload keeps them; the request refusal reads applicability through Info.capability. - main's DeepSeek native path in prompt.zig is kept as is: its encoder has a real switch (the synthetic source names enable_thinking and thinking_mode) and writes <|Assistant|></think> itself, so it is never refused. Tests beyond #2170's: raw completions, a switched template whose off render ends without </think>, DeepSeek off through the OpenAI route, the listing shape and the reload. The 17 /v1/models goldens gain only the two fields and their Content-Length. Part of #2139.
Every PR merged since v1.2.4 now has exactly one line under Unreleased: duplicate lines from stacked and train-merged PRs are removed (#2280, #2384, #2532, #2548, #2170, #2506, #2304, #2241), keeping the fuller line; #2280's and #2344's lines carry their own numbers; #2176 names the #1335 it carries; and the finders of #2515's and #2463's problems and #2526's reporter are thanked by handle. The 1.2.4 section is unchanged.
Part of #2139.
On a template that has
</think>but no switch, thinking off was accepted and then ignored unless the prompt happened to end in a dangling<think>, so the client got a 200 and the model still thought. An explicit thinking off that can't be honoured is now refused before anything is submitted.What keeps working: requests that don't ask for it, server defaults, raw completions, templates with a real switch, and prompts that already close thinking keep their token ids, with tests for each.
Who could notice: a client that explicitly turns thinking off on such a template now gets a 400 instead of a reply with thinking in it.
A host test through the real text and OpenAI paths fails on main and passes here, and the frozen HTTP goldens show no unexpected difference. No device run.