[PR #490] [MERGED] Fix local LM studio connection json error #4639

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/490
Author: @smurfboyyessir
Created: 5/6/2026
Status: ✅ Merged
Merged: 5/7/2026
Merged by: @cha1latte

Base: main ← Head: fix/lm_studio_json_error_fix


📝 Commits (7)

  • 37f38d0 Fix local LM studio connection json error
  • f49d1e1 Add timeout for generating assets
  • ced1ea0 Address PR comments
  • 668d6bb No local sidecar carveout
  • de5e554 Address asset generation timeout cancellation
  • 70505c2 Preserve prompt review cancel behavior
  • b60eb53 Await generated illustration installation

📊 Changes

3 files changed (+150 additions, -46 deletions)

View changed files

📝 packages/client/src/components/game/GameSurface.tsx (+132 -41)
📝 packages/client/src/lib/api-client.ts (+2 -1)
📝 packages/server/src/services/llm/providers/openai.provider.ts (+16 -4)

📄 Description

Description

Closes #496

What changed

Core fix is converting json_object request to json_schema request type: https://github.com/Pasta-Devs/Marinara-Engine/pull/490/changes#diff-41cf0ca77fcb41665c8a4bff06a93d6e8623103b53fc2389d2ffa27c8057aa8fR131-R139

The other changes are relating to some error handling which I needed to add to get things moving forward in my environment. I can get rid of them if a more focused PR is preferred, but these improvements seem nice-to-have:

  • Tightened synchronization so narration reliably unlocks only after scene assets (backgrounds, music, images) finish applying, with deterministic handling on success, error, or timeout paths and consistent advancement of narration gating.
  • Improved asset-generation flow with explicit timeouts, cancellation handling, deterministic pending-state clearing, and timed protection for preview/prompt-review to avoid hangs and ensure consistent outcomes.

Why this change

Because LM studio for starting new games does not work (see issue linked above)

Validation

  • pnpm check
  • pnpm version:check
  • pnpm build
  • Manually verified I can now start games properly without getting stuck and failing

Summary by CodeRabbit

  • Bug Fixes

    • Improved game scene loading reliability with explicit readiness gating across asset generation pathways.
    • Enhanced timeout handling for asset generation with graceful fallbacks and deterministic error recovery.
  • Improvements

    • Better compatibility with OpenAI-compatible LLM providers through response format normalization.
    • Extended API flexibility to support custom request configurations.

🔄 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/490 **Author:** [@smurfboyyessir](https://github.com/smurfboyyessir) **Created:** 5/6/2026 **Status:** ✅ Merged **Merged:** 5/7/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `main` ← **Head:** `fix/lm_studio_json_error_fix` --- ### 📝 Commits (7) - [`37f38d0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/37f38d0ff1826d19e65f7c5653b23c3b40793930) Fix local LM studio connection json error - [`f49d1e1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f49d1e198a7afb6a1200baef02a87b6cbd510a67) Add timeout for generating assets - [`ced1ea0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ced1ea0c8b43b9eaceb1d0a1d58129d7d0cf5a34) Address PR comments - [`668d6bb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/668d6bbb3e1abe09ad210bad8eb5b27ca909f4bb) No local sidecar carveout - [`de5e554`](https://github.com/Pasta-Devs/Marinara-Engine/commit/de5e554c751dd43e80f64388db71ad7329fb77a0) Address asset generation timeout cancellation - [`70505c2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/70505c21a2f19d20d602d6c3c0e6d04595a1597c) Preserve prompt review cancel behavior - [`b60eb53`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b60eb53ed9c4b6cb43ca1b5f80c543c28fcc9f45) Await generated illustration installation ### 📊 Changes **3 files changed** (+150 additions, -46 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/game/GameSurface.tsx` (+132 -41) 📝 `packages/client/src/lib/api-client.ts` (+2 -1) 📝 `packages/server/src/services/llm/providers/openai.provider.ts` (+16 -4) </details> ### 📄 Description # Description Closes #496 ## What changed Core fix is converting json_object request to json_schema request type: https://github.com/Pasta-Devs/Marinara-Engine/pull/490/changes#diff-41cf0ca77fcb41665c8a4bff06a93d6e8623103b53fc2389d2ffa27c8057aa8fR131-R139 The other changes are relating to some error handling which I needed to add to get things moving forward in my environment. I can get rid of them if a more focused PR is preferred, but these improvements seem nice-to-have: * Tightened synchronization so narration reliably unlocks only after scene assets (backgrounds, music, images) finish applying, with deterministic handling on success, error, or timeout paths and consistent advancement of narration gating. * Improved asset-generation flow with explicit timeouts, cancellation handling, deterministic pending-state clearing, and timed protection for preview/prompt-review to avoid hangs and ensure consistent outcomes. ## Why this change Because LM studio for starting new games does not work (see issue linked above) ## Validation - [x] pnpm check - [x] pnpm version:check - [x] pnpm build - [x] Manually verified I can now start games properly without getting stuck and failing <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved game scene loading reliability with explicit readiness gating across asset generation pathways. * Enhanced timeout handling for asset generation with graceful fallbacks and deterministic error recovery. * **Improvements** * Better compatibility with OpenAI-compatible LLM providers through response format normalization. * Extended API flexibility to support custom request configurations. <!-- 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-22 04:09:23 +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#4639
No description provided.