[PR #920] [MERGED] Fix game sprite recovery #4839

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

📋 Pull Request Information

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

Base: staging ← Head: fix/game-sprite-recovery


📝 Commits (1)

📊 Changes

3 files changed (+99 additions, -9 deletions)

View changed files

📝 packages/client/src/components/game/GameNarration.tsx (+32 -1)
📝 packages/client/src/components/game/GameSurface.tsx (+34 -2)
📝 packages/client/src/components/game/game-asset-generation-payload.ts (+33 -6)

📄 Description

Linked issue

No linked issue yet. User-reported bug: sometimes in game mode a sprite/portrait never generates even with image generation enabled, and the AI needs a way to recover.

Why this change

  • A stale or broken generated NPC portrait URL could make game mode believe a sprite was already resolved, so automatic image generation would not retry and the missing sprite could stay missing indefinitely.

What changed

  • Track failed NPC portrait image loads from the game narration UI.
  • Feed failed NPC names into the missing game asset payload so they are force-regenerated even when stale metadata still has an avatar URL.
  • Clear the failed-load marker after a successful upload or generated portrait patch.

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

  • Codex reproduced the stuck state with node scratch/repro-game-sprite-stale-avatar.mjs: before the fix, a stale NPC avatar URL suppressed asset generation with a null payload.
  • Codex re-ran node scratch/repro-game-sprite-stale-avatar.mjs after the fix: an observed failed avatar load now produces npcsNeedingAvatars and forceNpcAvatarNames for the NPC.
  • Codex ran pnpm check; it passed impeccable:check, lint, and shared/server/client builds.
  • Not manually verified against a real image provider because this environment does not have the user's image generation provider/API key configured. The retry decision path is covered by the scratch repro.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

No docs, release metadata, schema, or dependency changes.

UI evidence (if applicable)

N/A. This is a recovery-path fix for broken NPC portrait loads; Codex verified the payload path with a scratch repro rather than a provider-backed browser session.


🔄 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/920 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/16/2026 **Status:** ✅ Merged **Merged:** 5/16/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `staging` ← **Head:** `fix/game-sprite-recovery` --- ### 📝 Commits (1) - [`a7b8a51`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a7b8a51c89daa93c2d9f78bfad18fddcd51d6591) Fix game sprite recovery ### 📊 Changes **3 files changed** (+99 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/game/GameNarration.tsx` (+32 -1) 📝 `packages/client/src/components/game/GameSurface.tsx` (+34 -2) 📝 `packages/client/src/components/game/game-asset-generation-payload.ts` (+33 -6) </details> ### 📄 Description <!-- Target branch: `staging`. The default base in this UI is `main` (release branch). --> <!-- Change the base to `staging` before submitting unless this is a maintainer-approved mainline change. --> <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue <!-- Every PR should reference a feature request or issue report. If there isn't one yet, open one first to gather opinions: --> <!-- https://github.com/Pasta-Devs/Marinara-Engine/issues/new/choose --> No linked issue yet. User-reported bug: sometimes in game mode a sprite/portrait never generates even with image generation enabled, and the AI needs a way to recover. ## Why this change <!-- What user problem, bug, or goal does this solve? --> - A stale or broken generated NPC portrait URL could make game mode believe a sprite was already resolved, so automatic image generation would not retry and the missing sprite could stay missing indefinitely. ## What changed <!-- List the key changes in this PR --> - Track failed NPC portrait image loads from the game narration UI. - Feed failed NPC names into the missing game asset payload so they are force-regenerated even when stale metadata still has an avatar URL. - Clear the failed-load marker after a successful upload or generated portrait patch. ## Validation <!-- Required: include commands run and/or manual checks performed --> - [ ] `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 <!-- Describe exactly what you tested in a real browser/app, step by step. --> <!-- ⚠️ If an AI agent filled out or ticked these boxes for you, treat them --> <!-- as a TO-DO LIST, not as proof the work is done. Verify each item yourself --> <!-- before submitting. If you haven't verified it, untick the box. --> - Codex reproduced the stuck state with `node scratch/repro-game-sprite-stale-avatar.mjs`: before the fix, a stale NPC avatar URL suppressed asset generation with a `null` payload. - Codex re-ran `node scratch/repro-game-sprite-stale-avatar.mjs` after the fix: an observed failed avatar load now produces `npcsNeedingAvatars` and `forceNpcAvatarNames` for the NPC. - Codex ran `pnpm check`; it passed `impeccable:check`, lint, and shared/server/client builds. - Not manually verified against a real image provider because this environment does not have the user's image generation provider/API key configured. The retry decision path is covered by the scratch repro. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) No docs, release metadata, schema, or dependency changes. ## UI evidence (if applicable) N/A. This is a recovery-path fix for broken NPC portrait loads; Codex verified the payload path with a scratch repro rather than a provider-backed browser session. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:11:04 +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#4839
No description provided.