[GH-ISSUE #1024] [Issue]: imported presets can invisibly disable reasoning #500

Closed
opened 2026-10-20 17:29:32 +07:00 by bsakaguchi · 1 comment
Owner

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

Summary

Some imported sillytavern presets incorrectly disables thinking in marinara-engine.

Expected behavior

The setting displayed in 'Chat Settings > Advanced Parameters > Reasoning Effort should apply to the chat at all times.

Actual behavior

When importing a preset that has 'thinking' set to automatic, marinara-engine disables thinking entirely.

Steps to reproduce

  1. Import a preset from the internet, such as 'Chatfill II.json'
  2. Start a new chat with any character.
  3. Under 'Chat Settings', select 'Imported: Chatfill II'
  4. Send a message
  5. The response does not have any 'thinking' data in it. the brain icon is not present and it started printing the message so fast as to suggest that thinking did not occur. viewing the debug info does not show a reasoning block where one is expected.
  6. Under 'Chat Settings' > 'Advanced parameters' I observe that 'Reasoning Effort' is already set to 'Maximum'.
  7. Toggle reasoning effort to high and then back to Maximum.
  8. Send a message to the character.
  9. Thinking now works as usual.

Environment

  • Marinara Engine version: You're on the latest release (v1.6.0)
  • Install type: from source
  • OS + version: alma linux 10.1
  • Browser or app shell: mozzarella foxfire

Logs, screenshots, or video

Additional context

An RCA will appear in the pr

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 @jake9000 on GitHub (May 20, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1024 ## Summary Some imported sillytavern presets incorrectly disables thinking in marinara-engine. ## Expected behavior The setting displayed in 'Chat Settings > Advanced Parameters > Reasoning Effort should apply to the chat at all times. ## Actual behavior When importing a preset that has 'thinking' set to automatic, marinara-engine disables thinking entirely. ## Steps to reproduce 1. Import a preset from the internet, such as 'Chatfill II.json' 2. Start a new chat with any character. 3. Under 'Chat Settings', select 'Imported: Chatfill II' 4. Send a message 5. The response does not have any 'thinking' data in it. the brain icon is not present and it started printing the message so fast as to suggest that thinking did not occur. viewing the debug info does not show a reasoning block where one is expected. 6. Under 'Chat Settings' > 'Advanced parameters' I observe that 'Reasoning Effort' is already set to 'Maximum'. 7. Toggle reasoning effort to high and then back to Maximum. 8. Send a message to the character. 9. Thinking now works as usual. ## Environment - Marinara Engine version: You're on the latest release (v1.6.0) - Install type: from source - OS + version: alma linux 10.1 - Browser or app shell: mozzarella foxfire ## Logs, screenshots, or video ## Additional context An RCA will appear in the pr ## 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.
Author
Owner

@jake9000 commented on GitHub (May 20, 2026):

Root Cause Analysis: Thinking Stops Working After Importing Presets

Summary

Importing a SillyTavern preset (e.g., Chatfill II) causes thinking/reasoning to stop working, even though the UI shows "Reasoning Effort: Maximum." Toggling the setting to "High" and back to "Maximum" restores it. The bug has one primary cause and two contributing factors.


Primary Cause: ST Importer Doesn't Handle "auto" for reasoning_effort

The imported preset Chatfill II.json contains "reasoning_effort": "auto" (line 624). In SillyTavern, "auto" means "let the provider decide," which for reasoning-capable models typically enables thinking.

In Marinara's ST importer (packages/server/src/services/import/st-prompt.importer.ts:29-32):

const VALID_REASONING = new Set(["low", "medium", "high", "maximum"]);
function toReasoningEffort(v: unknown) {
  if (typeof v === "string" && VALID_REASONING.has(v))
    return v as "low" | "medium" | "high" | "maximum";
  return null;  // <-- "auto" falls through to null
}

"auto" is not in the valid set, so it maps to null. The imported preset stores reasoningEffort: null in the DB.


Contributing Factor #1: null Passes Through applyParameterOverrides as an Explicit Override

In packages/server/src/routes/generate.routes.ts:2926:

if (params.reasoningEffort !== undefined)
  reasoningEffort = params.reasoningEffort;

This means a preset's reasoningEffort: null is treated as an explicit override to disable reasoning, not as "unset / fall through to defaults." The trigger chain:

  1. Line 1633 — Preset parameters applied:
    reasoningEffort = assembled.parameters.reasoningEffort ?? null → null

  2. Line 2961 — Connection defaults: no override (connection params don't set reasoningEffort)

  3. Line 2962 — Chat overrides: no override (chat params don't set reasoningEffort)

  4. Line 2966 — Resolution:
    resolvedEffort = reasoningEffort !== "maximum" ? reasoningEffort : null → null

  5. Line 2997 — Thinking flag:
    const enableThinking = !!resolvedEffort → false


Contributing Factor #2: UI/Runtime Value Mismatch

The client-side "Advanced Parameters" UI in ChatSettingsDrawer.tsx:5895-5902 computes the displayed value from a separate chain:

mode defaults → connection defaults → chat overrides

It never reads the prompt preset's parameters. Both mode defaults (CHAT_PARAMETER_DEFAULTS and ROLEPLAY_PARAMETER_DEFAULTS) hardcode reasoningEffort: "maximum", so the UI always shows "Maximum" — even when the active preset's stored value is null.

This is why step 6 of the repro shows "Reasoning Effort is already set to Maximum" while thinking is actually disabled.


Why Toggling Fixes It

When the user toggles reasoning effort from "Maximum" → "High" → "Maximum", the client writes reasoningEffort: "maximum" to chat.chatParameters (line 5905 of ChatSettingsDrawer.tsx). Now applyParameterOverrides(chatParams) at line 2962 picks it up as "maximum", overriding the preset's null. The "maximum" → model-specific resolution (lines 2964-2975) then maps it to "xhigh" or "high", and thinking works.

<!-- gh-comment-id:4494196638 --> @jake9000 commented on GitHub (May 20, 2026): # Root Cause Analysis: Thinking Stops Working After Importing Presets ## Summary Importing a SillyTavern preset (e.g., Chatfill II) causes thinking/reasoning to stop working, even though the UI shows "Reasoning Effort: Maximum." Toggling the setting to "High" and back to "Maximum" restores it. The bug has one **primary cause** and two **contributing factors**. --- ## Primary Cause: ST Importer Doesn't Handle `"auto"` for `reasoning_effort` The imported preset `Chatfill II.json` contains `"reasoning_effort": "auto"` (line 624). In SillyTavern, `"auto"` means "let the provider decide," which for reasoning-capable models typically enables thinking. In Marinara's ST importer (`packages/server/src/services/import/st-prompt.importer.ts:29-32`): ```ts const VALID_REASONING = new Set(["low", "medium", "high", "maximum"]); function toReasoningEffort(v: unknown) { if (typeof v === "string" && VALID_REASONING.has(v)) return v as "low" | "medium" | "high" | "maximum"; return null; // <-- "auto" falls through to null } ``` `"auto"` is not in the valid set, so it maps to `null`. The imported preset stores `reasoningEffort: null` in the DB. --- ## Contributing Factor #1: `null` Passes Through `applyParameterOverrides` as an Explicit Override In `packages/server/src/routes/generate.routes.ts:2926`: ```ts if (params.reasoningEffort !== undefined) reasoningEffort = params.reasoningEffort; ``` This means a preset's `reasoningEffort: null` is treated as an **explicit override to disable reasoning**, not as "unset / fall through to defaults." The trigger chain: 1. **Line 1633** — Preset parameters applied: `reasoningEffort = assembled.parameters.reasoningEffort ?? null` → `null` 2. **Line 2961** — Connection defaults: no override (connection params don't set reasoningEffort) 3. **Line 2962** — Chat overrides: no override (chat params don't set reasoningEffort) 4. **Line 2966** — Resolution: `resolvedEffort = reasoningEffort !== "maximum" ? reasoningEffort : null` → `null` 5. **Line 2997** — Thinking flag: `const enableThinking = !!resolvedEffort` → **`false`** --- ## Contributing Factor #2: UI/Runtime Value Mismatch The client-side "Advanced Parameters" UI in `ChatSettingsDrawer.tsx:5895-5902` computes the displayed value from a separate chain: ``` mode defaults → connection defaults → chat overrides ``` It **never reads the prompt preset's parameters**. Both mode defaults (`CHAT_PARAMETER_DEFAULTS` and `ROLEPLAY_PARAMETER_DEFAULTS`) hardcode `reasoningEffort: "maximum"`, so the UI **always shows "Maximum"** — even when the active preset's stored value is `null`. This is why step 6 of the repro shows "Reasoning Effort is already set to Maximum" while thinking is actually disabled. --- ## Why Toggling Fixes It When the user toggles reasoning effort from "Maximum" → "High" → "Maximum", the client writes `reasoningEffort: "maximum"` to `chat.chatParameters` (line 5905 of `ChatSettingsDrawer.tsx`). Now `applyParameterOverrides(chatParams)` at line 2962 picks it up as `"maximum"`, overriding the preset's `null`. The `"maximum"` → model-specific resolution (lines 2964-2975) then maps it to `"xhigh"` or `"high"`, and thinking works.
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#500
No description provided.