[GH-ISSUE #4052] [Issue]: Hardcoded 45s GAME_DYNAMIC_IMAGE_PROMPT_TIMEOUT_MS causes GameGenerationTimeoutError on slower models #2182

Closed
opened 2026-10-21 05:46:04 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @Aculeasis on GitHub (Jul 24, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4052

Originally assigned to: @SpicyMarinara on GitHub.

Summary

The dynamic image prompt generation watchdog timeout is hardcoded to 45 seconds (GAME_DYNAMIC_IMAGE_PROMPT_TIMEOUT_MS = 45 * 1000 in packages/server/src/routes/game.routes.ts). During game portrait asset generation, slower LLM models or high-latency provider endpoints time out after 45 seconds and crash with a GameGenerationTimeoutError.

Expected behavior

The dynamic image prompt timeout should be configurable via environment variable (e.g. GAME_DYNAMIC_IMAGE_PROMPT_TIMEOUT_MS or DYNAMIC_IMAGE_PROMPT_TIMEOUT_MS in .env), falling back to a default of 45000 ms, similar to how timeouts are handled in PR #4025 and packages/server/src/config/runtime-config.ts, allowing slower models to complete prompt generation without erroring out.

Actual behavior

The server crashes dynamic portrait generation with GameGenerationTimeoutError: Game dynamic portrait image prompt timed out after 45 seconds due to the hardcoded 45-second limit in game.routes.ts, with no way to increase it in configuration.

Steps to reproduce

  1. Configure game asset generation using a slower LLM model or high-latency LLM provider.
  2. Trigger game portrait generation which invokes dynamic image prompt generation (maybeGenerateDynamicGameImagePrompt).
  3. Observe GameGenerationTimeoutError crash after 45 seconds due to the hardcoded watchdog timeout.

Environment

  • Marinara Engine version: 2.3.4
  • Install type: docker
  • OS + version: Ubuntu 24
  • Browser or app shell: Firefox 152.0.6

Logs, screenshots, or video

{"level":40,"time":1784907470063,"pid":13,"hostname":"60f0ece29888","err":{"type":"GameGenerationTimeoutError","message":"Game dynamic portrait image prompt timed out after 45 seconds","stack":"GameGenerationTimeoutError: Game dynamic portrait image prompt timed out after 45 seconds","name":"GameGenerationTimeoutError"},"msg":"[game-asset-gen] Dynamic image prompt generation failed"}

Additional context

  • Hardcoded timeout constant location: packages/server/src/routes/game.routes.ts:3029 (const GAME_DYNAMIC_IMAGE_PROMPT_TIMEOUT_MS = 45 * 1000;)
  • Logger catch location: packages/server/src/services/game/game-asset-generation.ts:705
  • Similar timeout env variable patterns were implemented in PR #4025 and in packages/server/src/config/runtime-config.ts (e.g., CHAT_GENERATION_TIMEOUT_MS, IMAGE_GEN_TIMEOUT_MS).

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 @Aculeasis on GitHub (Jul 24, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4052 Originally assigned to: @SpicyMarinara on GitHub. ## Summary The dynamic image prompt generation watchdog timeout is hardcoded to 45 seconds (GAME_DYNAMIC_IMAGE_PROMPT_TIMEOUT_MS = 45 * 1000 in packages/server/src/routes/game.routes.ts). During game portrait asset generation, slower LLM models or high-latency provider endpoints time out after 45 seconds and crash with a GameGenerationTimeoutError. ## Expected behavior The dynamic image prompt timeout should be configurable via environment variable (e.g. GAME_DYNAMIC_IMAGE_PROMPT_TIMEOUT_MS or DYNAMIC_IMAGE_PROMPT_TIMEOUT_MS in .env), falling back to a default of 45000 ms, similar to how timeouts are handled in PR #4025 and packages/server/src/config/runtime-config.ts, allowing slower models to complete prompt generation without erroring out. ## Actual behavior The server crashes dynamic portrait generation with `GameGenerationTimeoutError: Game dynamic portrait image prompt timed out after 45 seconds` due to the hardcoded 45-second limit in game.routes.ts, with no way to increase it in configuration. ## Steps to reproduce 1. Configure game asset generation using a slower LLM model or high-latency LLM provider. 2. Trigger game portrait generation which invokes dynamic image prompt generation (maybeGenerateDynamicGameImagePrompt). 3. Observe GameGenerationTimeoutError crash after 45 seconds due to the hardcoded watchdog timeout. ## Environment - Marinara Engine version: 2.3.4 - Install type: docker - OS + version: Ubuntu 24 - Browser or app shell: Firefox 152.0.6 ## Logs, screenshots, or video ```json {"level":40,"time":1784907470063,"pid":13,"hostname":"60f0ece29888","err":{"type":"GameGenerationTimeoutError","message":"Game dynamic portrait image prompt timed out after 45 seconds","stack":"GameGenerationTimeoutError: Game dynamic portrait image prompt timed out after 45 seconds","name":"GameGenerationTimeoutError"},"msg":"[game-asset-gen] Dynamic image prompt generation failed"} ``` ## Additional context - Hardcoded timeout constant location: packages/server/src/routes/game.routes.ts:3029 (const GAME_DYNAMIC_IMAGE_PROMPT_TIMEOUT_MS = 45 * 1000;) - Logger catch location: packages/server/src/services/game/game-asset-generation.ts:705 - Similar timeout env variable patterns were implemented in PR #4025 and in packages/server/src/config/runtime-config.ts (e.g., CHAT_GENERATION_TIMEOUT_MS, IMAGE_GEN_TIMEOUT_MS). ## 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.
bsakaguchi 2026-10-21 05:46:04 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Jul 24, 2026):

🔧 Ownership: @SpicyMarinara via Codex. Implementation is underway in draft PR #4060.

<!-- gh-comment-id:5073780819 --> @SpicyMarinara commented on GitHub (Jul 24, 2026): 🔧 Ownership: @SpicyMarinara via Codex. Implementation is underway in draft PR #4060.
Author
Owner

@SpicyMarinara commented on GitHub (Jul 24, 2026):

🔧 Ownership note: @SpicyMarinara is handling this in #4060 as part of the current open-issue sweep.

<!-- gh-comment-id:5073877929 --> @SpicyMarinara commented on GitHub (Jul 24, 2026): 🔧 Ownership note: @SpicyMarinara is handling this in #4060 as part of the current open-issue sweep.
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#2182
No description provided.