Skip to content

server: a thinking-off request renders the effort it names; --reasoning-effort can't change a thinking-off prompt (#1911) - #3017

Merged
ashhart merged 3 commits into
mainfrom
lead/glm-thinking-off-effort
Nov 14, 2026
Merged

ashhart merged 3 commits into
mainfrom
lead/glm-thinking-off-effort

Conversation

@ashhart

@ashhart ashhart commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Fixes #1911 (reported by @ss-cong): with thinking off, a request that named a reasoning effort still got GLM's default "Max" head, so the prompt was a few tokens off what the request asked for.

Change

  • With thinking off, the effort the request itself names reaches the template (server/fields.zig namedEffort, used by chat, completions-from-messages, the warm pass and Messages' count_tokens).
  • A server started with --reasoning-effort does not change a thinking-off prompt: only the request's own effort does, so default prompts stay byte-identical for every server configuration.
  • The reply's tensorfold.reasoning_effort reports the effort the template got, instead of none.
  • docs/api.md says so.

Qwen3.8: its template reads reasoning_effort only while thinking is on. With thinking off, a named effort reaches it but the prompt bytes don't change, and a test pins that. The test uses the real template, added as a fixture with its source and licence in THIRD_PARTY_NOTICES.md.

Tests: test-thinking-request-host 38/38, including:

  • a server started with --reasoning-effort high, where a thinking-off request that names nothing gets main's prompt;
  • the request's own low still winning;
  • the GLM and Qwen3.8 cases.

Putting back the server fallback and main's runtime line fails 3 of them. test-server-cpu 1,313 pass, 7 skipped; test-golden 0 unexpected differences; lean 0 new.

  • Synthena (Ash's Agent)

GLM-5.3's template writes "Reasoning Effort: Max" when it hears no effort,
so a thinking-off request could not ask for High or Low. With thinking off,
native now passes the template the effort the request (or
--reasoning-effort) named, on the template's levels. With none named, or
`none`, it passes null as before, so default prompts keep their bytes.
Prefix probes, the warm pass and the token-count route carry the same
named effort, so their renders match the request's.

Host tests: GLM-5.3 thinking-off requests with high, low, none, no effort
and a server effort, checked against the template's own render, and
namedEffort's rule (no Kimi max fallback, none is unnamed, request wins).
…1911)

--reasoning-effort no longer reaches a thinking-off prompt, so default
bytes stay unchanged for every server configuration. The reply's
tensorfold.reasoning_effort names the effort the template heard (the
request's, or none), and the Messages count_tokens route sets the named
effort as the chat route does.

Host tests: a server started with --reasoning-effort high keeps main's
thinking-off prompt; Qwen3.8's template takes a named effort with
thinking off (and reads it only while thinking, so its prompt is
unchanged), with its template and tokenizer config as fixtures.
@ashhart
ashhart force-pushed the lead/glm-thinking-off-effort branch from b0a3c88 to c1e2b42 Compare November 14, 2026 10:00
@ashhart
ashhart merged commit 3d42a46 into main Nov 14, 2026
2 of 10 checks passed
@ashhart
ashhart deleted the lead/glm-thinking-off-effort branch November 14, 2026 10:01
outcastofmusic added a commit to outcastofmusic/TensorFold that referenced this pull request Nov 25, 2026
…shhart#3017)

GLM-5.3's template writes "Reasoning Effort: Max" when it hears no effort, and the fork passed an effort only
while thinking, so a thinking-off GLM request could not ask for High or Low. With thinking off, the template now
hears the effort the request (or --reasoning-effort) named, on the template's levels. With none named, or
"none", it hears none as before, so default prompts keep their bytes. The chat route, the Anthropic token count,
the prompt-block and token routes and the Mac-style prompt path share template_effort.

Of the local checkpoints' templates, only GLM-5.3's changes with thinking off when an effort is passed
(Qwen3.8 Flash Next and 27B, Bolt, LFM2.5, KnowLine, Nanbeige, Clef and d1 render the same bytes).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012882unKVWq5Ve1jHg3xizt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

glm: the released Python engine renders the --no-thinking prompt 6-7 tokens shorter than the checkpoint template; native renders it verbatim

1 participant