mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3498] [Issue]: GLM thinking/reasoning silently broken — client/server default mismatch causes reasoningEffort to drop to null #1893
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1893
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @xDanteMD on GitHub (Jul 11, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3498
Originally assigned to: @SpicyMarinara on GitHub.
Summary
When using GLM models (from Zhipu/Z.ai) via the nanogpt provider, thinking/reasoning never activates — even when the user explicitly sets "Reasoning Effort: Maximum" in Advanced Parameters. The brain icon never appears. The root cause is a client/server default mismatch: the client defaults
reasoningEffortto"maximum"while the server defaults it tonull, causing the client to skip saving the parameter (it thinks it matches the default) and the server to receivenull(thinking disabled).Expected behavior
When a user sets Reasoning Effort to Maximum (or any non-null value) in Advanced Parameters, the model should produce reasoning/thinking output, and the brain icon should appear in the chat.
Actual behavior
The debug log shows:
Despite the UI showing "Reasoning Effort: Maximum" toggled on. The thinking parameter is never sent to the API.
Root cause analysis
The mismatch
reasoningEffortdefault"maximum"GenerationParametersEditor.tsxlines 66, 82nullconstants/defaults.tsline 32How the bug manifests
setParameters()inAdvancedParametersSection.tsx(line 126) compares each parameter againstdefaults[key]. SincereasoningEffort: "maximum" === defaults.reasoningEffort: "maximum", the parameter is NOT saved tochatParameterschatMeta.chatParameterswithoutreasoningEffortparseStoredGenerationParameters()returns{ reasoningEffort: undefined }(not in the stored object)resolveGenerationProviderRuntime()applies chat params — butundefineddoesn't trigger the override at line 94 (if (params.reasoningEffort !== undefined))runtime.reasoningEffortstays at the server default:nullresolvedEffort=null,enableThinking=falsebody.enable_thinkingis never set, or set tofalse— thinking is disabledKey code locations
packages/client/src/components/ui/GenerationParametersEditor.tsxlines 66, 82 —reasoningEffort: "maximum"packages/shared/src/constants/defaults.tsline 32 —reasoningEffort: nullpackages/client/src/features/chat-settings/sections/AdvancedParametersSection.tsxline 126 — only saves if different from defaultpackages/server/src/services/generation/provider-generation-runtime.tsline 94 — only applies if!== undefinedpackages/server/src/services/generation/provider-generation-runtime.tsline 152 —resolvedEffort = nullwhen reasoningEffort is nullSteps to reproduce
glm-4.7)EnableThinking: falseandEffort: noneEnvironment
Suggested fix
Option A (minimal, recommended): Align the server default with the client default.
In
packages/shared/src/constants/defaults.ts, change line 32:This ensures that when the client skips saving
reasoningEffort(because it matches the default), the server's fallback also defaults to"maximum", and thinking is enabled.Option B (more robust): Always save
reasoningEffortin the client regardless of whether it matches the default. InAdvancedParametersSection.tsx, remove the diff check forreasoningEffortspecifically, or change the client default tonullto match the server.Option A is the safest because it doesn't change client storage behavior and aligns with user expectations (Maximum is the sensible default for thinking-enabled models).
Additional context
API format is NOT the issue. Testing confirmed that nanogpt correctly handles
enable_thinking: trueand returnsreasoningcontent. The Zhipu API documentation specifiesthinking: { type: "enabled" }but nanogpt accepts the boolean form. The response field isreasoning(notreasoning_content), which Marinara'sextractReasoning()already checks.Test script results (both formats work via nanogpt):
enable_thinking: true(non-stream): 4044 chars thinking ✓thinking: {type:"enabled"}(non-stream): 1748 chars thinking ✓enable_thinking: true(stream): 2225 chars thinking ✓thinking: {type:"enabled"}(stream): 4549 chars thinking ✓This affects all thinking-capable models via nanogpt, not just GLM. Any model where the user relies on the default "Maximum" reasoning effort will have thinking silently disabled.
@SpicyMarinara commented on GitHub (Jul 11, 2026):
Claimed for implementation by @SpicyMarinara in draft PR #3507.
@SpicyMarinara commented on GitHub (Jul 11, 2026):
Addressed in PR #3507, which is ready for review and has CodeRabbit requested.