[PR #5683] [MERGED] fix(agents): preserve mandatory GLM reasoning #6881

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5683
Author: @Gunterlie
Created: 8/30/2026
Status: ✅ Merged
Merged: 8/30/2026
Merged by: @Gunterlie

Base: staging ← Head: staging


📝 Commits (3)

  • 9aff6f5 fix(agents): preserve mandatory GLM reasoning
  • 4124bb5 Merge remote-tracking branch 'origin/staging' into fix/5582-reasoning-only-agents
  • ec0a74a Merge remote-tracking branch 'origin/staging' into fix/5582-reasoning-only-agents

📊 Changes

4 files changed (+56 additions, -3 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 packages/server/src/services/llm/providers/glm-request-compat.ts (+6 -1)
📝 packages/server/src/services/llm/providers/openai.provider.ts (+2 -2)
📝 scripts/regressions/provider-compat.regression.ts (+46 -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 #5582

Why this change

  • JSON agents explicitly disable reasoning to protect their structured output budget. GLM 5.3 Flash requires reasoning on OpenRouter and NanoGPT, so those providers rejected agent requests before generation started.

What changed

  • Keep OpenRouter's provider-default reasoning for GLM 5.3 Flash instead of sending reasoning.effort: none.
  • Keep NanoGPT reasoning enabled for GLM 5.3 Flash while preserving explicit reasoning controls on native GLM endpoints.
  • Add request-shaping regressions for OpenRouter, NanoGPT, native GLM endpoints, and model ID suffixes.
  • Add the user-facing fix to the Unreleased changelog.

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

  • Automated request-body proof: pnpm regression:node --filter provider-compat
  • Agent override proof: pnpm regression:node --filter agent-runtime
  • Repository validation: pnpm check
  • Installer artifact guard: pnpm guard:installer-artifacts
  • Live OpenRouter and NanoGPT calls still need maintainer verification with configured provider credentials.

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)

UI evidence (if applicable)

Not applicable. This change only updates server-side provider request shaping.

Proof

  • OpenRouter GLM 5.3 Flash requests omit explicit reasoning-disable fields.
  • NanoGPT GLM 5.3 Flash requests send enable_thinking: true.
  • Native GLM requests preserve explicit reasoning-off behavior.
  • The targeted provider and agent regressions pass.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed GLM 5.3 Flash requests through OpenRouter and NanoGPT to preserve required reasoning settings.
    • Prevented unsupported reasoning-disable parameters from being sent, avoiding rejected requests.
    • Retained explicit reasoning controls for compatible native GLM endpoints.
  • Reliability
    • Added coverage for GLM 5.3 Flash behavior across supported providers and model variants.

🔄 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/5683 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 8/30/2026 **Status:** ✅ Merged **Merged:** 8/30/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `staging` ← **Head:** `staging` --- ### 📝 Commits (3) - [`9aff6f5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9aff6f5b0185f641d8317dd03ae5ec40e52b7cb6) fix(agents): preserve mandatory GLM reasoning - [`4124bb5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4124bb535f2defa21c525867bb84fa951ed3a78c) Merge remote-tracking branch 'origin/staging' into fix/5582-reasoning-only-agents - [`ec0a74a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ec0a74a798064c464be657019b324429c3ce01e9) Merge remote-tracking branch 'origin/staging' into fix/5582-reasoning-only-agents ### 📊 Changes **4 files changed** (+56 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `packages/server/src/services/llm/providers/glm-request-compat.ts` (+6 -1) 📝 `packages/server/src/services/llm/providers/openai.provider.ts` (+2 -2) 📝 `scripts/regressions/provider-compat.regression.ts` (+46 -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`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Closes #5582 ## Why this change - JSON agents explicitly disable reasoning to protect their structured output budget. GLM 5.3 Flash requires reasoning on OpenRouter and NanoGPT, so those providers rejected agent requests before generation started. ## What changed - Keep OpenRouter's provider-default reasoning for GLM 5.3 Flash instead of sending `reasoning.effort: none`. - Keep NanoGPT reasoning enabled for GLM 5.3 Flash while preserving explicit reasoning controls on native GLM endpoints. - Add request-shaping regressions for OpenRouter, NanoGPT, native GLM endpoints, and model ID suffixes. - Add the user-facing fix to the Unreleased changelog. ## 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 - Automated request-body proof: `pnpm regression:node --filter provider-compat` - Agent override proof: `pnpm regression:node --filter agent-runtime` - Repository validation: `pnpm check` - Installer artifact guard: `pnpm guard:installer-artifacts` - Live OpenRouter and NanoGPT calls still need maintainer verification with configured provider credentials. ## 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) ## UI evidence (if applicable) Not applicable. This change only updates server-side provider request shaping. ## Proof - OpenRouter GLM 5.3 Flash requests omit explicit reasoning-disable fields. - NanoGPT GLM 5.3 Flash requests send `enable_thinking: true`. - Native GLM requests preserve explicit reasoning-off behavior. - The targeted provider and agent regressions pass. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed GLM 5.3 Flash requests through OpenRouter and NanoGPT to preserve required reasoning settings. * Prevented unsupported reasoning-disable parameters from being sent, avoiding rejected requests. * Retained explicit reasoning controls for compatible native GLM endpoints. * **Reliability** * Added coverage for GLM 5.3 Flash behavior across supported providers and model variants. <!-- 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:14:33 +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#6881
No description provided.