[PR #7940] [MERGED] fix: remove preset token caps and inherit connection send switches #8015

Closed
opened 2026-10-24 04:09:40 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7940
Author: @SpicyMarinara
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/preset-caps-and-reasoning-defaults


📝 Commits (3)

  • 3d5dbee chore: track parameter inheritance fixes
  • 04ed6ea fix: keep token limits outside presets and inherit connection toggles
  • 10679c9 test: verify inherited game connection controls through public APIs

📊 Changes

15 files changed (+250 additions, -63 deletions)

View changed files

📝 docs/prompts/generation-parameters.md (+4 -4)
📝 e2e/generation-parameter-controls.e2e.ts (+102 -1)
📝 packages/client/src/components/presets/PresetEditor.tsx (+3 -2)
📝 packages/client/src/components/ui/GenerationParametersEditor.tsx (+4 -1)
📝 packages/client/src/features/chat-settings/sections/AdvancedParametersSection.tsx (+11 -4)
📝 packages/client/src/localization/locales/en.json (+1 -1)
📝 packages/server/src/db/default-preset.json (+1 -1)
📝 packages/server/src/routes/game.routes.ts (+3 -3)
📝 packages/server/src/routes/generate.routes.ts (+1 -13)
📝 packages/server/src/routes/generate/dry-run-route.ts (+2 -9)
📝 packages/server/src/routes/generate/parameter-preview-route.ts (+8 -12)
📝 packages/server/src/services/prompt/assembler.ts (+10 -5)
📝 packages/server/src/services/storage/prompts.storage.ts (+9 -7)
📝 packages/shared/src/types/prompt.ts (+15 -0)
➕ scripts/regressions/preset-token-limits.regression.ts (+76 -0)

📄 Description

Linked issue

Closes #7937.
Closes #7939.

Why this change

The maintainer requested that token limits belong in Connections and chat Advanced Parameters, rather than presets. The bundled preset still stored a 128k context value and an 8192-token output value. Separately, Game creation copied connection defaults into chat overrides, and editing any chat parameter saved every inherited Send switch as an explicit override. Those snapshots could keep the reasoning toggle from following a newly selected connection.

What changed

  • You can no longer set context or output token limits in presets. Use Connections or Chat Settings > Advanced Parameters for limits; existing preset files still load, but their old token limits and output Send switch are ignored. The bundled preset, saving, duplication, generation, dry-run, parameter preview, and preset editor follow this rule.
  • Game creation keeps effective connection settings in the setup summary while saving only actual setup/chat overrides as chat parameters.
  • Editing a chat parameter preserves inherited Send switches; only switches explicitly changed by the user become overrides. Existing explicit overrides remain effective when switching connections. Existing games may already contain inherited Send switches saved as chat overrides. Their intent cannot be inferred safely, so those maps are preserved. Use Reset to Defaults in Advanced Parameters, then reapply any intentional chat settings, to restore connection inheritance.
  • Updated the English parameter guide and preset hint.

Validation

At 10679c9ccae1006e70c92a3a8133b9ce099d4324:

  • Combined desktop Chromium smoke and focused parameter suite: 9/9 passed (7 smoke, 2 focused), one worker on isolated ports 7850/7851.

  • preset-token-limits, prompt, prompt-attachments, context-fit, game-generation-parameters, and stock-preset-protection regressions passed.

  • Final pnpm check and repeated pnpm regression:prompt passed. The check reports one existing HomeProfessorMariChat hook dependency warning, with no errors.

  • First local CodeRabbit pass: no findings. Completed follow-up review reported two findings: a shorter hint (fixed) and translated documentation (included in #7946). No substantive code findings remain.

  • 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

  • Manually verify on the reported Termux/Samsung Browser installation that switching Game connections changes inherited reasoning level and Send switch. For existing games that already saved inherited Send maps as overrides, use Advanced Parameters > Reset to Defaults, then reapply deliberate chat settings. No migration guesses which old maps were intentional.
  • Manually verify deliberately saved chat overrides still apply when switching connections.
  • Manually verify the preset editor has no token-limit controls and Connections/chat Advanced Parameters retain their controls.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened
  • Version/release files updated (only if this PR includes a version bump)

The generation-parameters guide translation is included in docs-i18n PR #7946, tracking #7917. No release metadata or changelog changes.

UI evidence

Automated desktop Chromium coverage checks preset controls and actual Game creation, unrelated parameter editing, connection switches, and explicit Send overrides. Physical Android/Samsung Browser verification remains a manual check.

Summary by CodeRabbit

  • Changed
    • Presets no longer control context-window or output-token limits; legacy preset limits are ignored.
    • Configure context limits through Connections and output limits through Connections or Chat Settings.
    • Preset editors no longer display token-limit controls.
    • Default output limit is now 4,096 tokens.
    • Chat settings preserve only explicit overrides, while inherited connection settings continue to apply.
    • Resetting inherited settings now clears manual overrides appropriately.
  • Bug Fixes
    • Improved parameter inheritance and persistence when changing connections or editing chat settings.

🔄 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/7940 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/preset-caps-and-reasoning-defaults` --- ### 📝 Commits (3) - [`3d5dbee`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3d5dbee0d744e5456eb50594b0795b926c50496b) chore: track parameter inheritance fixes - [`04ed6ea`](https://github.com/Pasta-Devs/Marinara-Engine/commit/04ed6eaa4f3048e6370b1b41b76090cb2976db1d) fix: keep token limits outside presets and inherit connection toggles - [`10679c9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/10679c9ccae1006e70c92a3a8133b9ce099d4324) test: verify inherited game connection controls through public APIs ### 📊 Changes **15 files changed** (+250 additions, -63 deletions) <details> <summary>View changed files</summary> 📝 `docs/prompts/generation-parameters.md` (+4 -4) 📝 `e2e/generation-parameter-controls.e2e.ts` (+102 -1) 📝 `packages/client/src/components/presets/PresetEditor.tsx` (+3 -2) 📝 `packages/client/src/components/ui/GenerationParametersEditor.tsx` (+4 -1) 📝 `packages/client/src/features/chat-settings/sections/AdvancedParametersSection.tsx` (+11 -4) 📝 `packages/client/src/localization/locales/en.json` (+1 -1) 📝 `packages/server/src/db/default-preset.json` (+1 -1) 📝 `packages/server/src/routes/game.routes.ts` (+3 -3) 📝 `packages/server/src/routes/generate.routes.ts` (+1 -13) 📝 `packages/server/src/routes/generate/dry-run-route.ts` (+2 -9) 📝 `packages/server/src/routes/generate/parameter-preview-route.ts` (+8 -12) 📝 `packages/server/src/services/prompt/assembler.ts` (+10 -5) 📝 `packages/server/src/services/storage/prompts.storage.ts` (+9 -7) 📝 `packages/shared/src/types/prompt.ts` (+15 -0) ➕ `scripts/regressions/preset-token-limits.regression.ts` (+76 -0) </details> ### 📄 Description ## Linked issue Closes #7937. Closes #7939. ## Why this change The maintainer requested that token limits belong in Connections and chat Advanced Parameters, rather than presets. The bundled preset still stored a 128k context value and an 8192-token output value. Separately, Game creation copied connection defaults into chat overrides, and editing any chat parameter saved every inherited Send switch as an explicit override. Those snapshots could keep the reasoning toggle from following a newly selected connection. ## What changed - You can no longer set context or output token limits in presets. Use Connections or Chat Settings > Advanced Parameters for limits; existing preset files still load, but their old token limits and output Send switch are ignored. The bundled preset, saving, duplication, generation, dry-run, parameter preview, and preset editor follow this rule. - Game creation keeps effective connection settings in the setup summary while saving only actual setup/chat overrides as chat parameters. - Editing a chat parameter preserves inherited Send switches; only switches explicitly changed by the user become overrides. Existing explicit overrides remain effective when switching connections. Existing games may already contain inherited Send switches saved as chat overrides. Their intent cannot be inferred safely, so those maps are preserved. Use Reset to Defaults in Advanced Parameters, then reapply any intentional chat settings, to restore connection inheritance. - Updated the English parameter guide and preset hint. ## Validation At `10679c9ccae1006e70c92a3a8133b9ce099d4324`: - Combined desktop Chromium smoke and focused parameter suite: 9/9 passed (7 smoke, 2 focused), one worker on isolated ports 7850/7851. - `preset-token-limits`, `prompt`, `prompt-attachments`, `context-fit`, `game-generation-parameters`, and `stock-preset-protection` regressions passed. - Final `pnpm check` and repeated `pnpm regression:prompt` passed. The check reports one existing `HomeProfessorMariChat` hook dependency warning, with no errors. - First local CodeRabbit pass: no findings. Completed follow-up review reported two findings: a shorter hint (fixed) and translated documentation (included in #7946). No substantive code findings remain. - [ ] `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 - Manually verify on the reported Termux/Samsung Browser installation that switching Game connections changes inherited reasoning level and Send switch. For existing games that already saved inherited Send maps as overrides, use Advanced Parameters > Reset to Defaults, then reapply deliberate chat settings. No migration guesses which old maps were intentional. - Manually verify deliberately saved chat overrides still apply when switching connections. - Manually verify the preset editor has no token-limit controls and Connections/chat Advanced Parameters retain their controls. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened - [ ] Version/release files updated (only if this PR includes a version bump) The generation-parameters guide translation is included in [docs-i18n PR #7946](https://github.com/Pasta-Devs/Marinara-Engine/pull/7946), tracking #7917. No release metadata or changelog changes. ## UI evidence Automated desktop Chromium coverage checks preset controls and actual Game creation, unrelated parameter editing, connection switches, and explicit Send overrides. Physical Android/Samsung Browser verification remains a manual check. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit - **Changed** - Presets no longer control context-window or output-token limits; legacy preset limits are ignored. - Configure context limits through Connections and output limits through Connections or Chat Settings. - Preset editors no longer display token-limit controls. - Default output limit is now 4,096 tokens. - Chat settings preserve only explicit overrides, while inherited connection settings continue to apply. - Resetting inherited settings now clears manual overrides appropriately. - **Bug Fixes** - Improved parameter inheritance and persistence when changing connections or editing chat settings. <!-- 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-24 04:09:40 +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#8015
No description provided.