mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #5734] [CLOSED] fix(llm): preserve mandatory GLM 5.3 reasoning on custom and native Z.Ai endpoints #6910
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#6910
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5734
Author: @tempestnano
Created: 9/1/2026
Status: ❌ Closed
Base:
staging← Head:fix/5582-glm-5-3-mandatory-reasoning-custom-native📝 Commits (1)
fcb2349fix(llm): keep GLM 5.3 mandatory reasoning on custom and native endpoints📊 Changes
4 files changed (+94 additions, -15 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
packages/server/src/services/llm/providers/glm-request-compat.ts(+11 -4)📝
packages/server/src/services/llm/providers/openai.provider.ts(+4 -4)📝
scripts/regressions/provider-compat.regression.ts(+78 -7)📄 Description
Linked issue
Closes #5582 — follow-up to #5683. #5582 was closed by #5683, but the reporter's configuration (a custom OpenAI-compatible connection, not OpenRouter/NanoGPT) still failed; this PR closes the remaining gap, so the issue may need reopening until this merges.
Why this change
The reporter's connection is a custom endpoint pointing at
https://api.z.ai/api/coding/paas/v4with modelglm-5.3-flash(plainglm-5.3behaves the same). #5683 fixed OpenRouter and NanoGPT, but two remaining request paths still sent a reasoning-disable that Z.Ai rejects with400: This model always engages in thinking and cannot be disabled; please use low, high, or max:api.z.aiis a native-GLM hostname, the GLM request shim stampedenable_thinking: falseinto every request — including a bare connection Test Message that passes no reasoning options at all ("no preference" collapsed to "disable").reasoning_effort: "none"for the same models.The detector also matched only the exact string
glm-5.3-flash, so plainglm-5.3would hit the identical rejection.What changed
isGlm53FlashMandatoryReasoningModel→isGlm53MandatoryReasoningModeland widened it to the whole GLM 5.3 family (glm-5.3,glm-5.3-flash, provider-prefixed and suffixed variants; still excludesglm-5.2and would not matchglm-5.35).applyGlmThinkingParameters: on native GLM endpoints, GLM 5.3 models with no active reasoning request now omitenable_thinkingentirely instead of sendingenable_thinking: false, deferring to the provider's always-on default. NanoGPT keeps its required explicitenable_thinking: true. Older GLMs (e.g.glm-5) keep the working explicit disable, andglm-5.2keeps itsthinking.typehandling — both locked by new regression assertions.reasoning_effort: "none"for GLM 5.3 family models.glm-5.3as well (via the renamed detector).provider-compatregression coverage: native bare/none/enable cases, NanoGPT plain 5.3, custom-branch end-to-end, OpenRouter plain 5.3, and detector edge cases.[Unreleased]CHANGELOG entry.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Automated request-body proof:
pnpm regression:node --filter provider-compat— passes, including the new native/custom/OpenRouter GLM 5.3 cases.pnpm regression:node --filter agent-runtime— passes.https://api.z.ai/api/coding/paas/v4,glm-5.3-flash) against a local capture server: before the fix the request body containedenable_thinking: false; after the fix no reasoning-disable fields are present.Live verification (performed by the reporter on the real Z.Ai endpoint with provider credentials):
glm-5.3-flash— succeeds after the fix.glm-5.3— succeeds after the fix.Still open before merge (unticked above on purpose):
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)The CHANGELOG
[Unreleased]entry is included in this PR; no other docs, translations, or version files are affected (server-side request shaping only).UI evidence (if applicable)
Not applicable. This change only updates server-side provider request shaping.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.