[PR #6059] [MERGED] fix(game): stop satellite connections inheriting chat-wide generation parameters #7044

Closed
opened 2026-10-23 04:16:01 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6059
Author: @Romuromylus
Created: 9/11/2026
Status: ✅ Merged
Merged: 9/11/2026
Merged by: @Romuromylus

Base: staging ← Head: fix/scene-analysis-parameter-scoping


📝 Commits (3)

  • b7b87a7 fix(game): stop satellite connections inheriting chat-wide generation parameters
  • 7730b5f fix(game): never inherit chat parameters on a fallback connection
  • 45acba3 fix(game): report the connection the illustrator prompt resolver actually used

📊 Changes

3 files changed (+147 additions, -13 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 packages/server/src/routes/game.routes.ts (+73 -13)
➕ scripts/regressions/game-satellite-connection-parameters.regression.ts (+73 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #6049

Why this change

  • Scene Analysis (and its siblings) already resolve their own connection through gameSceneConnectionId, but the generation parameters for that call were still built by merging meta.chatParameters, the chat-wide bag the user edits against the main roleplay connection. Its customParameters (for example an OpenRouter provider routing object, or Vertex-only fields) therefore travelled to a different provider, which rejected the request with the OpenRouter 404 / Gemini 400 described in the issue.
  • Roleplay's auxiliary paths (chat summary, image captioning) already use only the resolved connection's own defaults. Game Mode's satellites now follow the same rule.

What changed

  • resolveStoredGameGenerationParameters takes an includeChatParameters option (default true, so every untouched call site is unchanged).
  • New inheritsChatGenerationParameters guard: chat parameters are inherited only when the resolved connection is the chat's own connection (a chat on the random pool inherits whenever no dedicated connection was requested). A dedicated satellite connection, or a fallback such as the default agent connection, uses its own defaults plus the game setup parameters.
  • Applied at the four satellite call sites: /scene-wrap (Scene Analysis), the illustration narration summarizer, the dynamic illustrator prompt rewriter, and the storyboard planner (both its game and roleplay branches).
  • Regression scripts/regressions/game-satellite-connection-parameters.regression.ts pins the merge behaviour and the guard.
  • CHANGELOG entry.

Behaviour note: a satellite running on its own connection no longer picks up sampler tweaks (temperature, reasoning effort, etc.) set for the main chat either. That is the intended scoping, matching how Roleplay's summarizer and captioning already behave.

Out of scope: the game endpoints that accept a one-off connectionId in the request body (conclusion, progression, recruit cards, party turn, the lorebook keeper queued after a conclusion) still inherit the chat parameters. Those run the main roleplay flow through another connection for one call rather than acting as a separate agent, so today's behaviour is kept there.

Validation

  • 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

  • pnpm check green locally; pnpm --filter @marinara-engine/server lint green; node scripts/run-regressions.mjs --filter game-satellite-connection-parameters and --filter prompt.regression pass.
  • Manually verify on the production deploy: main connection with a custom provider parameter + Scene Analysis on a different provider; play a turn and confirm /scene-wrap succeeds.

Docs and release impact

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

UI evidence (if applicable)

N/A (server-side only).

Summary by CodeRabbit

  • Bug Fixes

    • Fixed Game Mode satellite calls so Scene Analysis, illustration prompt rewriting, storyboard planning, and scene summaries use the selected connection’s generation settings.
    • Prevented provider-specific chat settings from interfering with satellite connections when different AI providers are used.
    • Corrected connection resolution for dynamic image prompts and unavailable scene connections.
  • Tests

    • Added regression coverage for generation-parameter handling across main, dedicated, and random-pool connections.

🔄 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/6059 **Author:** [@Romuromylus](https://github.com/Romuromylus) **Created:** 9/11/2026 **Status:** ✅ Merged **Merged:** 9/11/2026 **Merged by:** [@Romuromylus](https://github.com/Romuromylus) **Base:** `staging` ← **Head:** `fix/scene-analysis-parameter-scoping` --- ### 📝 Commits (3) - [`b7b87a7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b7b87a7201fc7e176e6bffd3b12a92e58dc87604) fix(game): stop satellite connections inheriting chat-wide generation parameters - [`7730b5f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7730b5f5fa48fa2cae7a5b67f7bec8332ab44f96) fix(game): never inherit chat parameters on a fallback connection - [`45acba3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/45acba3f64d03f11f846a7bab7dc8b2127938742) fix(game): report the connection the illustrator prompt resolver actually used ### 📊 Changes **3 files changed** (+147 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `packages/server/src/routes/game.routes.ts` (+73 -13) ➕ `scripts/regressions/game-satellite-connection-parameters.regression.ts` (+73 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Closes #6049 ## Why this change - Scene Analysis (and its siblings) already resolve their own connection through `gameSceneConnectionId`, but the generation parameters for that call were still built by merging `meta.chatParameters`, the chat-wide bag the user edits against the **main** roleplay connection. Its `customParameters` (for example an OpenRouter `provider` routing object, or Vertex-only fields) therefore travelled to a different provider, which rejected the request with the OpenRouter 404 / Gemini 400 described in the issue. - Roleplay's auxiliary paths (chat summary, image captioning) already use only the resolved connection's own defaults. Game Mode's satellites now follow the same rule. ## What changed - `resolveStoredGameGenerationParameters` takes an `includeChatParameters` option (default `true`, so every untouched call site is unchanged). - New `inheritsChatGenerationParameters` guard: chat parameters are inherited only when the resolved connection is the chat's own connection (a chat on the random pool inherits whenever no dedicated connection was requested). A dedicated satellite connection, or a fallback such as the default agent connection, uses its own defaults plus the game setup parameters. - Applied at the four satellite call sites: `/scene-wrap` (Scene Analysis), the illustration narration summarizer, the dynamic illustrator prompt rewriter, and the storyboard planner (both its game and roleplay branches). - Regression `scripts/regressions/game-satellite-connection-parameters.regression.ts` pins the merge behaviour and the guard. - CHANGELOG entry. Behaviour note: a satellite running on its own connection no longer picks up sampler tweaks (temperature, reasoning effort, etc.) set for the main chat either. That is the intended scoping, matching how Roleplay's summarizer and captioning already behave. Out of scope: the game endpoints that accept a one-off `connectionId` in the request body (conclusion, progression, recruit cards, party turn, the lorebook keeper queued after a conclusion) still inherit the chat parameters. Those run the main roleplay flow through another connection for one call rather than acting as a separate agent, so today's behaviour is kept there. ## Validation - [x] `pnpm check` passes locally - [x] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes - `pnpm check` green locally; `pnpm --filter @marinara-engine/server lint` green; `node scripts/run-regressions.mjs --filter game-satellite-connection-parameters` and `--filter prompt.regression` pass. - Manually verify on the production deploy: main connection with a custom `provider` parameter + Scene Analysis on a different provider; play a turn and confirm `/scene-wrap` succeeds. ## Docs and release impact - [ ] No docs changes needed - [x] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) N/A (server-side only). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed Game Mode satellite calls so Scene Analysis, illustration prompt rewriting, storyboard planning, and scene summaries use the selected connection’s generation settings. * Prevented provider-specific chat settings from interfering with satellite connections when different AI providers are used. * Corrected connection resolution for dynamic image prompts and unavailable scene connections. * **Tests** * Added regression coverage for generation-parameter handling across main, dedicated, and random-pool connections. <!-- 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-23 04:16:01 +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#7044
No description provided.