[GH-ISSUE #4335] [Issue]: Custom OpenAI-compatible connections send reasoning_effort to unsupported models #2349

Closed
opened 2026-10-21 05:47:32 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @SpicyMarinara on GitHub (Jul 31, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4335

Originally assigned to: @SpicyMarinara on GitHub.

Summary

On staging, chats using a custom OpenAI-compatible provider send an inherited reasoning_effort value to non-reasoning models. Providers such as Ollama reject the request, causing the chat turn to fail.

Expected behavior

Marinara should omit reasoning_effort when the selected model does not support reasoning, unless a compatible model and explicitly supported effort are configured.

Actual behavior

A chat without a prompt preset inherits the default reasoning effort, which resolves from "maximum" to "high" and is sent through generic custom providers without applying the existing model capability gate. Ollama returns HTTP 400 because the selected model does not support thinking.

Steps to reproduce

  1. Use the Marinara staging version.
  2. Configure a custom OpenAI-compatible provider connection pointing to Ollama.
  3. Select a non-thinking model such as dolphin3:8b.
  4. Start a chat with no prompt preset.
  5. Send a message.
  6. Observe that the request includes reasoning_effort set to "high" and Ollama rejects it with HTTP 400.

Environment

  • Marinara Engine version: Staging version; exact version not provided
  • Install type: Not provided
  • OS + version: Not provided
  • Browser or app shell: Not provided

Logs, screenshots, or video

Wire capture from a logging proxy in front of Ollama:
POST /v1/chat/completions
{"model":"dolphin3:8b", ..., "reasoning_effort":"high"}
Response: 400 {"error":{"message":""dolphin3:8b" does not support thinking"}}

Reported code path:

  • shared/src/constants/defaults.ts:40 sets DEFAULT_GENERATION_PARAMS.reasoningEffort to "maximum"; chats with promptPresetId: null inherit it.
  • shared/src/constants/model-lists.ts:73 maps "maximum" to "high" for models not known to support max/xhigh.
  • server/src/services/llm/providers/openai.provider.ts:805 sends active reasoning_effort for generic custom providers and returns before the model gate.
  • isReasoningModel() at line 598 reportedly returns false for generic custom providers, but is only consulted later at line 842.

Additional context

The reporter suggested reusing shouldSendReasoningEffort(options.model, options.reasoningEffort) in the generic custom-provider branch. Caveat: this may prevent custom endpoints proxying real reasoning models from sending effort except for recognized models such as gpt-5.5/5.6. Alternatives suggested were sending the field only when explicitly configured rather than inherited, or retrying once without it after a 400 response. Editing presets to set reasoning effort to none is a partial workaround, but no None/null effort preset reportedly ships by default, and the issue can reappear after changing a preset connection. Whether setting Reasoning to Off still sends the field was asked but not answered in the provided context.

Discord thread: Bug: custom OpenAI-compatible connections send reasoning_effort to models that don't support it
Discord thread link: https://discord.com/channels/1417099416812392641/1532521921646821376
Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653)

Discord thread transcript (4 messages)
[2026-07-30T22:54:59.001Z] holyknight3: Found on the Staging version, as opposed to live.
Repro: custom provider connection pointed at Ollama, any non-thinking model (dolphin3:8b), chat with no prompt preset. Send a message.

Wire capture (logging proxy in front of Ollama):


POST /v1/chat/completions
{"model":"dolphin3:8b", ... ,"reasoning_effort":"high"}
<-- 400 {"error":{"message":"\"dolphin3:8b\" does not support thinking"}}
Not degraded output — the turn fails outright.

Chain

shared/src/constants/defaults.ts:40 — DEFAULT_GENERATION_PARAMS.reasoningEffort = "maximum". A chat with promptPresetId: null inherits it.
shared/src/constants/model-lists.ts:73 — resolveProviderReasoningEffort maps "maximum" → "high" for any model not known to support max/xhigh, which is every local model.
server/src/services/llm/providers/openai.provider.ts:805 — applyChatCompletionsReasoning:

if (this.isGenericCustomProvider()) {
  if (this.hasActiveReasoningEffort(options.reasoningEffort)) {
    body.reasoning_effort = options.reasoningEffort;
  }
  return;   // <-- returns before the model gate
}
The correct gate already exists: isReasoningModel() (line 598) returns false for generic custom providers. It's only consulted at line 842, which this branch returns before reaching — bypassed, not missing.

Fix — reuse the existing helper from line 765:


if (this.shouldSendReasoningEffort(options.model, options.reasoningEffort)) {
  body.reasoning_effort = options.reasoningEffort;
}
return;
Caveat: that stops custom connections sending effort except for gpt-5.5/5.6, regressing anyone who proxies a real reasoning model through a custom endpoint. Alternatives if that matters: send only when the user explicitly set an effort rather than inheriting the default, or retry once without the field on a 400.
[Discord message: https://discord.com/channels/1417099416812392641/1532521921646821376/1532521921646821376]

[2026-07-30T23:06:10.729Z] Kat: can't you set reasoning effort to none in the connection configuration?
[Discord message: https://discord.com/channels/1417099416812392641/1532521921646821376/1532524739078389840]

[2026-07-31T00:08:54.431Z] holyknight3: Yes, sorta. I was spinning up a test environment when I found it, and you can, but you have to actually edit the presets to do so. It isn't shipping with a None effort preset, or a null effort preset, and the bug reappears every time you change a preset connection, so it's something that does need looked into, otherwise you will end up with the lorebooks not saving issue all over again.
[Discord message: https://discord.com/channels/1417099416812392641/1532521921646821376/1532540525188743429]

[2026-07-31T07:29:16.323Z] Marinara: Setting Reasoning to Off still sends it?
[Discord message: https://discord.com/channels/1417099416812392641/1532521921646821376/1532651346636046366]

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @SpicyMarinara on GitHub (Jul 31, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4335 Originally assigned to: @SpicyMarinara on GitHub. ## Summary On staging, chats using a custom OpenAI-compatible provider send an inherited reasoning_effort value to non-reasoning models. Providers such as Ollama reject the request, causing the chat turn to fail. ## Expected behavior Marinara should omit reasoning_effort when the selected model does not support reasoning, unless a compatible model and explicitly supported effort are configured. ## Actual behavior A chat without a prompt preset inherits the default reasoning effort, which resolves from "maximum" to "high" and is sent through generic custom providers without applying the existing model capability gate. Ollama returns HTTP 400 because the selected model does not support thinking. ## Steps to reproduce 1. Use the Marinara staging version. 2. Configure a custom OpenAI-compatible provider connection pointing to Ollama. 3. Select a non-thinking model such as dolphin3:8b. 4. Start a chat with no prompt preset. 5. Send a message. 6. Observe that the request includes reasoning_effort set to "high" and Ollama rejects it with HTTP 400. ## Environment - Marinara Engine version: Staging version; exact version not provided - Install type: Not provided - OS + version: Not provided - Browser or app shell: Not provided ## Logs, screenshots, or video Wire capture from a logging proxy in front of Ollama: POST /v1/chat/completions {"model":"dolphin3:8b", ..., "reasoning_effort":"high"} Response: 400 {"error":{"message":"\"dolphin3:8b\" does not support thinking"}} Reported code path: - shared/src/constants/defaults.ts:40 sets DEFAULT_GENERATION_PARAMS.reasoningEffort to "maximum"; chats with promptPresetId: null inherit it. - shared/src/constants/model-lists.ts:73 maps "maximum" to "high" for models not known to support max/xhigh. - server/src/services/llm/providers/openai.provider.ts:805 sends active reasoning_effort for generic custom providers and returns before the model gate. - isReasoningModel() at line 598 reportedly returns false for generic custom providers, but is only consulted later at line 842. ## Additional context The reporter suggested reusing shouldSendReasoningEffort(options.model, options.reasoningEffort) in the generic custom-provider branch. Caveat: this may prevent custom endpoints proxying real reasoning models from sending effort except for recognized models such as gpt-5.5/5.6. Alternatives suggested were sending the field only when explicitly configured rather than inherited, or retrying once without it after a 400 response. Editing presets to set reasoning effort to none is a partial workaround, but no None/null effort preset reportedly ships by default, and the issue can reappear after changing a preset connection. Whether setting Reasoning to Off still sends the field was asked but not answered in the provided context. Discord thread: Bug: custom OpenAI-compatible connections send reasoning_effort to models that don't support it Discord thread link: https://discord.com/channels/1417099416812392641/1532521921646821376 Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653) <details> <summary>Discord thread transcript (4 messages)</summary> ```text [2026-07-30T22:54:59.001Z] holyknight3: Found on the Staging version, as opposed to live. Repro: custom provider connection pointed at Ollama, any non-thinking model (dolphin3:8b), chat with no prompt preset. Send a message. Wire capture (logging proxy in front of Ollama): POST /v1/chat/completions {"model":"dolphin3:8b", ... ,"reasoning_effort":"high"} <-- 400 {"error":{"message":"\"dolphin3:8b\" does not support thinking"}} Not degraded output — the turn fails outright. Chain shared/src/constants/defaults.ts:40 — DEFAULT_GENERATION_PARAMS.reasoningEffort = "maximum". A chat with promptPresetId: null inherits it. shared/src/constants/model-lists.ts:73 — resolveProviderReasoningEffort maps "maximum" → "high" for any model not known to support max/xhigh, which is every local model. server/src/services/llm/providers/openai.provider.ts:805 — applyChatCompletionsReasoning: if (this.isGenericCustomProvider()) { if (this.hasActiveReasoningEffort(options.reasoningEffort)) { body.reasoning_effort = options.reasoningEffort; } return; // <-- returns before the model gate } The correct gate already exists: isReasoningModel() (line 598) returns false for generic custom providers. It's only consulted at line 842, which this branch returns before reaching — bypassed, not missing. Fix — reuse the existing helper from line 765: if (this.shouldSendReasoningEffort(options.model, options.reasoningEffort)) { body.reasoning_effort = options.reasoningEffort; } return; Caveat: that stops custom connections sending effort except for gpt-5.5/5.6, regressing anyone who proxies a real reasoning model through a custom endpoint. Alternatives if that matters: send only when the user explicitly set an effort rather than inheriting the default, or retry once without the field on a 400. [Discord message: https://discord.com/channels/1417099416812392641/1532521921646821376/1532521921646821376] [2026-07-30T23:06:10.729Z] Kat: can't you set reasoning effort to none in the connection configuration? [Discord message: https://discord.com/channels/1417099416812392641/1532521921646821376/1532524739078389840] [2026-07-31T00:08:54.431Z] holyknight3: Yes, sorta. I was spinning up a test environment when I found it, and you can, but you have to actually edit the presets to do so. It isn't shipping with a None effort preset, or a null effort preset, and the bug reappears every time you change a preset connection, so it's something that does need looked into, otherwise you will end up with the lorebooks not saving issue all over again. [Discord message: https://discord.com/channels/1417099416812392641/1532521921646821376/1532540525188743429] [2026-07-31T07:29:16.323Z] Marinara: Setting Reasoning to Off still sends it? [Discord message: https://discord.com/channels/1417099416812392641/1532521921646821376/1532651346636046366] ``` </details> ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:47:32 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Jul 31, 2026):

Reasoning effort set to none should send "reasoning_effort": none. We should add an option labeled Off that sends the reasoning as off/none. Disabling the toggle for thinking in Advanced Parameters should not send any reasoning/reasoning_effort fields at all.

<!-- gh-comment-id:5141368337 --> @SpicyMarinara commented on GitHub (Jul 31, 2026): Reasoning effort set to none should send `"reasoning_effort": none`. We should add an option labeled `Off` that sends the reasoning as off/none. Disabling the toggle for thinking in Advanced Parameters should not send any reasoning/reasoning_effort fields at all.
Author
Owner

@SpicyMarinara commented on GitHub (Jul 31, 2026):

Implementation is in progress by @SpicyMarinara with Codex in draft PR #4340. This issue is part of the current focused staging sweep; existing code paths will be reused and kept narrow.

<!-- gh-comment-id:5141428382 --> @SpicyMarinara commented on GitHub (Jul 31, 2026): Implementation is in progress by @SpicyMarinara with Codex in draft PR #4340. This issue is part of the current focused staging sweep; existing code paths will be reused and kept narrow.
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#2349
No description provided.