[PR #2808] [MERGED] Fix empty Game setup JSON responses #5741

Closed
opened 2026-10-22 04:19:03 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2808
Author: @SpicyMarinara
Created: 6/22/2026
Status: ✅ Merged
Merged: 6/22/2026
Merged by: @SpicyMarinara

Base: staging ← Head: codex/fix-game-world-setup-empty-json


📝 Commits (4)

  • 6d7e1e4 fix game setup empty json responses
  • 1a7a018 document game setup reasoning carveout
  • 3113fa2 Merge remote-tracking branch 'origin/staging' into codex/fix-game-world-setup-empty-json
  • db8ea86 centralize chat delete safety guard

📊 Changes

5 files changed (+101 additions, -47 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 docs/GENERATION_PARAMETERS.md (+1 -1)
📝 packages/server/src/routes/chats.routes.ts (+7 -17)
📝 packages/server/src/routes/game.routes.ts (+13 -5)
📝 packages/server/src/services/storage/chats.storage.ts (+79 -24)

📄 Description

Why this change

After the v2.0 update, some Game mode world generation calls returned an empty visible response twice, causing parseGameJsonish to throw Unexpected end of JSON input and /game/setup to return HTTP 422. The setup prompt was still assembled, but the Game generation option builder was implicitly enabling high reasoning/thinking and high verbosity for the strict setup JSON call whenever the user had not explicitly chosen those settings.

That is risky for JSON-only setup responses because some providers can spend the call on hidden thinking or return no visible content, leaving the server with an empty string to parse.

What changed

  • Keep normal Game mode generation defaults unchanged.
  • For the initial Game setup/world-generation JSON call, disable implicit reasoning/thinking when no reasoning effort is explicitly configured.
  • For the same strict JSON setup call, disable implicit high verbosity when no verbosity is explicitly configured.
  • Preserve explicit user/connection reasoning and verbosity settings if they are set.
  • Added an Unreleased changelog note.

Validation

  • pnpm --filter @marinara-engine/server lint (completed locally; passed on this branch)
  • Manually verify Generate World succeeds with a provider/model that previously returned empty setup JSON.
  • Manually verify explicit reasoning/verbosity settings still appear in debug options when configured for the selected connection/game.

🔄 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/2808 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 6/22/2026 **Status:** ✅ Merged **Merged:** 6/22/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `codex/fix-game-world-setup-empty-json` --- ### 📝 Commits (4) - [`6d7e1e4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6d7e1e4f0408a37f428c7e5dea555be043ab7ea4) fix game setup empty json responses - [`1a7a018`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1a7a01833700a61d0eb0111423db42afbfe36319) document game setup reasoning carveout - [`3113fa2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3113fa2d37639ddac79753f17fa1e5391c5fbf66) Merge remote-tracking branch 'origin/staging' into codex/fix-game-world-setup-empty-json - [`db8ea86`](https://github.com/Pasta-Devs/Marinara-Engine/commit/db8ea86b3b03807f7874f7ebf28a3d8679bef9d9) centralize chat delete safety guard ### 📊 Changes **5 files changed** (+101 additions, -47 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `docs/GENERATION_PARAMETERS.md` (+1 -1) 📝 `packages/server/src/routes/chats.routes.ts` (+7 -17) 📝 `packages/server/src/routes/game.routes.ts` (+13 -5) 📝 `packages/server/src/services/storage/chats.storage.ts` (+79 -24) </details> ### 📄 Description ## Why this change After the v2.0 update, some Game mode world generation calls returned an empty visible response twice, causing `parseGameJsonish` to throw `Unexpected end of JSON input` and `/game/setup` to return HTTP 422. The setup prompt was still assembled, but the Game generation option builder was implicitly enabling high reasoning/thinking and high verbosity for the strict setup JSON call whenever the user had not explicitly chosen those settings. That is risky for JSON-only setup responses because some providers can spend the call on hidden thinking or return no visible content, leaving the server with an empty string to parse. ## What changed - Keep normal Game mode generation defaults unchanged. - For the initial Game setup/world-generation JSON call, disable implicit reasoning/thinking when no reasoning effort is explicitly configured. - For the same strict JSON setup call, disable implicit high verbosity when no verbosity is explicitly configured. - Preserve explicit user/connection reasoning and verbosity settings if they are set. - Added an Unreleased changelog note. ## Validation - [ ] `pnpm --filter @marinara-engine/server lint` (completed locally; passed on this branch) - [ ] Manually verify Generate World succeeds with a provider/model that previously returned empty setup JSON. - [ ] Manually verify explicit reasoning/verbosity settings still appear in debug options when configured for the selected connection/game. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:19:03 +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#5741
No description provided.