[PR #6965] [MERGED] fix(llm): turn off reasoning for GLM on NanoGPT when it's set to Off #7406

Closed
opened 2026-10-23 04:19:29 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6965
Author: @SpicyMarinara
Created: 10/2/2026
Status: ✅ Merged
Merged: 10/2/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/reasoning-off


📝 Commits (2)

  • d1a9aef fix(llm): send NanoGPT's reasoning off switch for GLM models
  • e74c7a6 Merge remote-tracking branch 'origin/staging' into fix/reasoning-off

📊 Changes

3 files changed (+71 additions, -0 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 packages/server/src/services/llm/providers/glm-request-compat.ts (+3 -0)
➕ scripts/regressions/nanogpt-glm-reasoning-off.regression.ts (+66 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #6961

Why this change

With GLM 4.7 or 5.1 on NanoGPT, setting Reasoning Effort to Off did nothing. The model kept reasoning and could use up the whole reply budget, which ended in "Raise Max Tokens or lower Reasoning Effort".

Off wasn't lost anywhere. For GLM on NanoGPT, Marinara only sent enable_thinking: false, which NanoGPT doesn't document. NanoGPT's documented way to turn reasoning off is reasoning_effort: "none". Marinara already sends that for every other NanoGPT model, but the GLM path returned before reaching that code.

What changed

  • glm-request-compat.ts: an explicit Off on NanoGPT now also sends reasoning_effort: "none", alongside enable_thinking: false.
  • Not changed:
    • native Z.AI;
    • GLM 5.3, which can't turn reasoning off and still gets its lowest level;
    • any request with reasoning on.
  • New regression nanogpt-glm-reasoning-off.regression.ts: runs the real parameter resolution and provider against a mock NanoGPT server for GLM 4.7 and 5.1. It covers Off taken from the connection, Off set on the chat, and a chat that turns reasoning back on.
  • CHANGELOG entry.

About the second part of the report ("chats don't inherit the connection defaults"): I couldn't find a separate bug. A chat with no preset parameters does take Off from the connection's Default Chat Parameters, and the regression checks that. It most likely looked broken because the model kept reasoning anyway. A value saved on the chat itself still wins on purpose, and "Reset to defaults" clears it.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

What I ran (not a replacement for the checklist):

  • Checks: pnpm check passes.
  • New regression: fails without the fix (reasoning_effort missing) and passes with it.
  • Related regressions: 25 pass, covering provider compat, parameters, NanoGPT, reasoning history and Responses.
  • Local CodeRabbit: 0 findings.
  • Not tested against the live NanoGPT API; this follows NanoGPT's own docs.

To check by hand:

  • With a NanoGPT connection on GLM 4.7 or 5.1, set Reasoning Effort to Off in the connection's Default Chat Parameters, then send a message in a chat with no preset parameters. The reply should come without reasoning.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

CHANGELOG entry only.

UI evidence (if applicable)

Server-side only.

Summary by CodeRabbit

  • Bug Fixes
    • GLM models on NanoGPT now stop reasoning when Reasoning Effort is set to Off, whether configured in chat or inherited from Default Chat Parameters. This prevents reasoning from consuming the reply budget and triggering a “raise Max Tokens” message.
  • Documentation
    • Updated the unreleased notes to describe this behavior and the previous issue.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/6965 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/2/2026 **Status:** ✅ Merged **Merged:** 10/2/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/reasoning-off` --- ### 📝 Commits (2) - [`d1a9aef`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d1a9aef60805f3b28016839e28b6dd42b8da92da) fix(llm): send NanoGPT's reasoning off switch for GLM models - [`e74c7a6`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e74c7a6512fcd1c354442fc281ade89c2d11b72a) Merge remote-tracking branch 'origin/staging' into fix/reasoning-off ### 📊 Changes **3 files changed** (+71 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `packages/server/src/services/llm/providers/glm-request-compat.ts` (+3 -0) ➕ `scripts/regressions/nanogpt-glm-reasoning-off.regression.ts` (+66 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #6961 ## Why this change With GLM 4.7 or 5.1 on NanoGPT, setting Reasoning Effort to **Off** did nothing. The model kept reasoning and could use up the whole reply budget, which ended in "Raise Max Tokens or lower Reasoning Effort". Off wasn't lost anywhere. For GLM on NanoGPT, Marinara only sent `enable_thinking: false`, which NanoGPT doesn't document. NanoGPT's documented way to turn reasoning off is `reasoning_effort: "none"`. Marinara already sends that for every other NanoGPT model, but the GLM path returned before reaching that code. ## What changed - **`glm-request-compat.ts`:** an explicit Off on NanoGPT now also sends `reasoning_effort: "none"`, alongside `enable_thinking: false`. - **Not changed:** - native Z.AI; - GLM 5.3, which can't turn reasoning off and still gets its lowest level; - any request with reasoning on. - **New regression `nanogpt-glm-reasoning-off.regression.ts`:** runs the real parameter resolution and provider against a mock NanoGPT server for GLM 4.7 and 5.1. It covers Off taken from the connection, Off set on the chat, and a chat that turns reasoning back on. - **CHANGELOG entry.** About the second part of the report ("chats don't inherit the connection defaults"): I couldn't find a separate bug. A chat with no preset parameters does take Off from the connection's Default Chat Parameters, and the regression checks that. It most likely looked broken because the model kept reasoning anyway. A value saved on the chat itself still wins on purpose, and "Reset to defaults" clears it. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes What I ran (not a replacement for the checklist): - **Checks:** `pnpm check` passes. - **New regression:** fails without the fix (`reasoning_effort` missing) and passes with it. - **Related regressions:** 25 pass, covering provider compat, parameters, NanoGPT, reasoning history and Responses. - **Local CodeRabbit:** 0 findings. - **Not tested against the live NanoGPT API;** this follows NanoGPT's own docs. To check by hand: - With a NanoGPT connection on GLM 4.7 or 5.1, set Reasoning Effort to Off in the connection's Default Chat Parameters, then send a message in a chat with no preset parameters. The reply should come without reasoning. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) CHANGELOG entry only. ## UI evidence (if applicable) Server-side only. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * GLM models on NanoGPT now stop reasoning when Reasoning Effort is set to Off, whether configured in chat or inherited from Default Chat Parameters. This prevents reasoning from consuming the reply budget and triggering a “raise Max Tokens” message. * **Documentation** * Updated the unreleased notes to describe this behavior and the previous issue. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:19:29 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#7406
No description provided.