[GH-ISSUE #2713] [Issue]: Game-mode forced generation defaults are silently overwritten by chat-level Advanced Parameters #1358

Closed
opened 2026-10-21 05:32:10 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @kolacheee on GitHub (Jun 21, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2713

Originally assigned to: @SpicyMarinara on GitHub.

Summary

Game Mode forces "optimal" generation defaults (temperature=1, maxTokens=16384, reasoningEffort=maximum, etc.) for reliable structured GM output, and its own comment says it "ignores preset/chat overrides" — but the connection/chat Advanced-Parameter overrides are applied immediately after the force block and silently win, so a leftover chat-level parameter (e.g. a low maxTokens) degrades GM output and the trackers.

Expected behavior

If game mode is documented to force its own generation defaults for structured reliability, those forced values should actually take precedence (or the precedence should be the documented connection/chat-wins behavior — but not silently contradict the in-code comment and the feature's promise).

Actual behavior

The game-mode block forces temperature=1, maxTokens=16384, topP=1, topK=0, freq/pres=0, reasoningEffort='maximum', verbosity=null for non-Gemma game chats, with a comment that it should "ignore preset/chat overrides." But applyParameterOverrides(connectionParams) and applyParameterOverrides(chatParams) are called immediately after, and they unconditionally reassign temperature/maxTokens/topK/reasoningEffort/verbosity/etc. whenever the stored param is set. So a per-chat Advanced Parameter (e.g. maxTokens=512 or temperature=0.4, set once or inherited) clobbers the just-forced game defaults — yielding truncated/garbled GM JSON and degraded agents, presenting as "agent weirdness" that's impossible to diagnose because the UI claims game defaults are enforced.

How it breaks the pipeline

Code trace (staging @ b826f8f4) — packages/server/src/routes/generate.routes.ts:

  • Force block :3298-3312 (comment: "ignore preset/chat overrides").
  • applyParameterOverrides(connectionParams) / applyParameterOverrides(chatParams) at :3314-3315; applyParameterOverrides (:3263-3286) unconditionally reassigns the forced fields.

Steps to reproduce

  1. Create a game chat. In Chat Settings → Advanced Parameters set maxTokens small (e.g. 512) or temperature 0.3.
  2. Run a game turn → the GM/structured output is generated with the user override, not the forced 16384/temp=1 — contradicting the in-code comment, and causing truncated/garbled GM JSON.

Suggested fix

Confirm the intended precedence, then either move the game force block to after applyParameterOverrides(chatParams) so it truly wins, or gate the two applyParameterOverrides calls so game-forced fields aren't reapplied for non-Gemma game chats (skip maxTokens/temperature/reasoningEffort/topP/topK reassignment when chatMode==='game' && !isLocalGemma).

Environment

  • Marinara Engine version: 2.0.0 (staging @ b826f8f4)
  • Install type: source
  • OS + version: All (code-level defect, platform-independent)
  • Browser or app shell: All

Additional context

Found via a systematic multi-agent audit of Game Mode. A leftover chat-level maxTokens silently sabotaging the GM is a stealthy source of "game agents misbehave / truncated GM output". Part of a set of game-mode issues filed together.

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 @kolacheee on GitHub (Jun 21, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2713 Originally assigned to: @SpicyMarinara on GitHub. ## Summary Game Mode forces "optimal" generation defaults (temperature=1, maxTokens=16384, reasoningEffort=maximum, etc.) for reliable structured GM output, and its own comment says it "ignores preset/chat overrides" — but the connection/chat Advanced-Parameter overrides are applied **immediately after** the force block and silently win, so a leftover chat-level parameter (e.g. a low `maxTokens`) degrades GM output and the trackers. ## Expected behavior If game mode is documented to force its own generation defaults for structured reliability, those forced values should actually take precedence (or the precedence should be the documented connection/chat-wins behavior — but not silently contradict the in-code comment and the feature's promise). ## Actual behavior The game-mode block forces `temperature=1, maxTokens=16384, topP=1, topK=0, freq/pres=0, reasoningEffort='maximum', verbosity=null` for non-Gemma game chats, with a comment that it should "ignore preset/chat overrides." But `applyParameterOverrides(connectionParams)` and `applyParameterOverrides(chatParams)` are called **immediately after**, and they unconditionally reassign `temperature`/`maxTokens`/`topK`/`reasoningEffort`/`verbosity`/etc. whenever the stored param is set. So a per-chat Advanced Parameter (e.g. `maxTokens=512` or `temperature=0.4`, set once or inherited) clobbers the just-forced game defaults — yielding truncated/garbled GM JSON and degraded agents, presenting as "agent weirdness" that's impossible to diagnose because the UI claims game defaults are enforced. ## How it breaks the pipeline Code trace (staging @ `b826f8f4`) — `packages/server/src/routes/generate.routes.ts`: - Force block `:3298-3312` (comment: "ignore preset/chat overrides"). - `applyParameterOverrides(connectionParams)` / `applyParameterOverrides(chatParams)` at `:3314-3315`; `applyParameterOverrides` (`:3263-3286`) unconditionally reassigns the forced fields. ## Steps to reproduce 1. Create a game chat. In Chat Settings → Advanced Parameters set `maxTokens` small (e.g. 512) or `temperature` 0.3. 2. Run a game turn → the GM/structured output is generated with the user override, not the forced 16384/temp=1 — contradicting the in-code comment, and causing truncated/garbled GM JSON. ## Suggested fix Confirm the intended precedence, then either move the game force block to **after** `applyParameterOverrides(chatParams)` so it truly wins, or gate the two `applyParameterOverrides` calls so game-forced fields aren't reapplied for non-Gemma game chats (skip `maxTokens`/`temperature`/`reasoningEffort`/`topP`/`topK` reassignment when `chatMode==='game' && !isLocalGemma`). ## Environment - Marinara Engine version: 2.0.0 (staging @ `b826f8f4`) - Install type: source - OS + version: All (code-level defect, platform-independent) - Browser or app shell: All ## Additional context Found via a systematic multi-agent audit of Game Mode. A leftover chat-level `maxTokens` silently sabotaging the GM is a stealthy source of "game agents misbehave / truncated GM output". Part of a set of game-mode issues filed together. ## 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

@SpicyMarinara commented on GitHub (Jun 21, 2026):

Fixed in a61ccac4. Non-Gemma game-mode generation defaults are now applied after connection/chat Advanced Parameters, so forced temperature/token/reasoning/sampling defaults actually take precedence while still allowing unrelated override data such as custom parameters and context settings to be merged first.

<!-- gh-comment-id:4761651724 --> @SpicyMarinara commented on GitHub (Jun 21, 2026): Fixed in a61ccac4. Non-Gemma game-mode generation defaults are now applied after connection/chat Advanced Parameters, so forced temperature/token/reasoning/sampling defaults actually take precedence while still allowing unrelated override data such as custom parameters and context settings to be merged first.
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#1358
No description provided.