[GH-ISSUE #424] [Issue]: GLM heuristic sends enable_thinking to non-GLM OpenAI-compatible providers (Venice), causing 400 errors on v1.5.7 #182

Closed
opened 2026-10-20 17:25:59 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @cha1latte on GitHub (May 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/424

Originally assigned to: @SpicyMarinara on GitHub.

Summary

The OpenAI-compatible provider injects enable_thinking into request bodies whenever the model ID contains the substring glm, which causes 400 errors on strict OpenAI-schema backends like Venice that serve GLM-named models. Discord post: https://discord.com/channels/1417099416812392641/1500990509999722637

Expected behavior

enable_thinking should only be sent to backends known to accept it (real GLM-hosted endpoints), not to every OpenAI-compatible connection that happens to be routing a model with glm in its name. Failing that, users should be able to strip or override request body fields from the connection settings.

Actual behavior

Every request from a Venice connection using a GLM-named model fails with a 400. The Venice schema validator rejects the enable_thinking key itself, not just its value, so the request never reaches the model. This fires on any chat mode and on the built-in Send Test Message button, so the connection is unusable end-to-end.

OpenAI API error 400: {"details":{"_errors":["Unrecognized key(s) in object: 'enable_thinking'"]},"issues":[{"code":"unrecognized_keys","keys":["enable_thinking"],"path":[],"message":"Unrecognized key(s) in object: 'enable_thinking'"}]}

Related but distinct from the (closed) #173: that one was about enable_thinking being sent unconditionally; this is the residual code path where it's still sent based on a model-ID heuristic, with no user-facing way to remove it.

Steps to reproduce

  1. Add an OpenAI-compatible connection pointed at Venice.
  2. Select any model whose ID contains glm.
  3. Hit Send Test Message (or send any normal chat). Request fails with the 400 above.

Workaround attempted: Setting enable_thinking in Default Chat Parameters → Custom Parameters with values false, null, and blank. Blank is rejected by the UI. false and null both still produce the same 400 — Venice rejects the key itself, so users would need to be able to strip the field, not override its value.

Environment

  • Marinara Engine version: v1.5.7
  • Install type: Manual (Windows installer fails — likely a separate issue)
  • OS + version: Windows 10 22H2
  • Browser or app shell: Browser

Logs, screenshots, or video

Screenshot of the failed Test Message:

Image

Full error from the screenshot:

OpenAI API error 400: {"details":{"_errors":["Unrecognized key(s) in object: 'enable_thinking'"]},"issues":[{"code":"unrecognized_keys","keys":["enable_thinking"],"path":[],"message":"Unrecognized key(s) in object: 'enable_thinking'"}]}

Additional context

Suspected cause — the GLM detection in the OpenAI-compatible provider is a substring check on the model ID:

private isGLMModel(model: string): boolean {
  return model.toLowerCase().includes("glm");
}

…and then:

if (this.isGLMModel(options.model)) {
  body.enable_thinking = this.hasActiveReasoningEffort(options.reasoningEffort);
  return;
}

This conflates "the model is a GLM family model" with "the backend speaks GLM's extended schema." Venice serves GLM-named models but uses strict OpenAI schema validation, so the assumption breaks.

Suggested fixes:

  1. Short term: scope the GLM-specific body injection to providers whose endpoint is actually a GLM-compatible host (Z.AI, etc.), not every OpenAI-compatible connection routing a GLM-named model.
  2. Longer term / better: add a SillyTavern-style Additional Parameters section on connections that lets users add, override, and remove request body fields and request headers. This would let users patch around any future provider/schema mismatch without waiting on a release.

Reported on Discord by user Rinha Osuzume.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @cha1latte on GitHub (May 5, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/424 Originally assigned to: @SpicyMarinara on GitHub. ## Summary The OpenAI-compatible provider injects `enable_thinking` into request bodies whenever the model ID contains the substring `glm`, which causes 400 errors on strict OpenAI-schema backends like Venice that serve GLM-named models. Discord post: https://discord.com/channels/1417099416812392641/1500990509999722637 ## Expected behavior `enable_thinking` should only be sent to backends known to accept it (real GLM-hosted endpoints), not to every OpenAI-compatible connection that happens to be routing a model with `glm` in its name. Failing that, users should be able to strip or override request body fields from the connection settings. ## Actual behavior Every request from a Venice connection using a GLM-named model fails with a 400. The Venice schema validator rejects the `enable_thinking` key itself, not just its value, so the request never reaches the model. This fires on any chat mode and on the built-in **Send Test Message** button, so the connection is unusable end-to-end. ``` OpenAI API error 400: {"details":{"_errors":["Unrecognized key(s) in object: 'enable_thinking'"]},"issues":[{"code":"unrecognized_keys","keys":["enable_thinking"],"path":[],"message":"Unrecognized key(s) in object: 'enable_thinking'"}]} ``` Related but distinct from the (closed) #173: that one was about `enable_thinking` being sent unconditionally; this is the residual code path where it's still sent based on a model-ID heuristic, with no user-facing way to remove it. ## Steps to reproduce 1. Add an OpenAI-compatible connection pointed at Venice. 2. Select any model whose ID contains `glm`. 3. Hit **Send Test Message** (or send any normal chat). Request fails with the 400 above. **Workaround attempted:** Setting `enable_thinking` in **Default Chat Parameters → Custom Parameters** with values `false`, `null`, and blank. Blank is rejected by the UI. `false` and `null` both still produce the same 400 — Venice rejects the key itself, so users would need to be able to *strip* the field, not override its value. ## Environment - Marinara Engine version: v1.5.7 - Install type: Manual (Windows installer fails — likely a separate issue) - OS + version: Windows 10 22H2 - Browser or app shell: Browser ## Logs, screenshots, or video Screenshot of the failed Test Message: <img width="1332" height="498" alt="Image" src="https://github.com/user-attachments/assets/7848620f-cf97-41c9-82b5-eff100b2a191" /> Full error from the screenshot: ``` OpenAI API error 400: {"details":{"_errors":["Unrecognized key(s) in object: 'enable_thinking'"]},"issues":[{"code":"unrecognized_keys","keys":["enable_thinking"],"path":[],"message":"Unrecognized key(s) in object: 'enable_thinking'"}]} ``` ## Additional context Suspected cause — the GLM detection in the OpenAI-compatible provider is a substring check on the model ID: ```ts private isGLMModel(model: string): boolean { return model.toLowerCase().includes("glm"); } ``` …and then: ```ts if (this.isGLMModel(options.model)) { body.enable_thinking = this.hasActiveReasoningEffort(options.reasoningEffort); return; } ``` This conflates "the model is a GLM family model" with "the backend speaks GLM's extended schema." Venice serves GLM-named models but uses strict OpenAI schema validation, so the assumption breaks. **Suggested fixes:** 1. **Short term:** scope the GLM-specific body injection to providers whose endpoint is actually a GLM-compatible host (Z.AI, etc.), not every OpenAI-compatible connection routing a GLM-named model. 2. **Longer term / better:** add a SillyTavern-style **Additional Parameters** section on connections that lets users add, override, and *remove* request body fields and request headers. This would let users patch around any future provider/schema mismatch without waiting on a release. Reported on Discord by user **Rinha Osuzume**. ## Template check - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-20 17:25:59 +07:00
  • closed this issue
  • added the
    bug
    label
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#182
No description provided.