[GH-ISSUE #5885] [Bug]: Asset Mapping Regression in Stable/Stagging — Frontend overrides Persona/Char avatar with random/broken images during Game Mode initialization #3247

Closed
opened 2026-10-21 06:01:07 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @scavru on GitHub (Sep 6, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5885

Originally assigned to: @SpicyMarinara on GitHub.

This is a summary of my attempts to figure out the problem using Google; Google itself compiled the report.
The Stagging version has the same problem

Description

A critical regression in the recent stable build completely breaks avatar routing and rendering in the UI during Game Mode/session initialization.

Thanks to deep investigation, the exact cause of this erratic behavior has been identified as a flawed path resolution and automated layout-fallback mechanism:

  1. Strict Name Matching Bug: When a new speaker/NPC appears in the game log, the backend performs a loose string-match lookup against the existing character library files. If the new character's Name happens to match ANY filename or card name inside the stored library, the engine automatically and permanently binds that character's image to the active speaker slot, completely ignoring unique ID segregation. Clearing the data folder of all existing characters is the only thing that stops this automatic false linking.
  2. Fallback Path Hijacking (SillyTavern Cache Leak): When the local data/avatars directory is entirely cleared or empty, the server's asset router fails to return a clean empty state. Instead, it falls back to parsing legacy import directories. It actively targets and extracts raw images directly from the SillyTavern import/migration cache path, forcing broken or completely random historical avatar overlays onto empty/new speaker containers.

The correct uploaded image momentarily flashes upon page refresh (Ctrl + F5), but is instantly overwritten by this broken asset retrieval loop. The bug bypasses Incognito sessions and standard IndexedDB/LocalStorage wipes because the faulty logic is hosted strictly within the backend's path-matching engine.


Steps to Reproduce

  1. Run the latest stable build of Marinara Engine with an existing library of character cards.
  2. Start a new Game Mode session using a speaker or NPC whose Name matches a card in your storage.
  3. Observe that the game instantly force-links the storage card's image to the active frame, overriding the local layout.
  4. Clear the data/avatars folder completely and initialize a session again.
  5. Observe the avatar container pulling and flashing random leftover images sourced straight from the SillyTavern import location.

Expected Behavior

The asset manager must enforce strict unique ID matching for image-to-character binding, preventing loose string name collisions. If an avatar folder or container is empty, the UI must strictly render a default placeholder or a transparent frame, instead of indexing and leaking images from the SillyTavern import cache.


Environment

  • Marinara Version: Stable branch (Latest release regression)
  • Deployment: Local Node.js server / Native desktop app container
  • Browser: Chromium-based / Standalone UI
Originally created by @scavru on GitHub (Sep 6, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5885 Originally assigned to: @SpicyMarinara on GitHub. This is a summary of my attempts to figure out the problem using Google; Google itself compiled the report. The Stagging version has the same problem ### Description A critical regression in the recent stable build completely breaks avatar routing and rendering in the UI during Game Mode/session initialization. Thanks to deep investigation, the exact cause of this erratic behavior has been identified as a flawed path resolution and automated layout-fallback mechanism: 1. **Strict Name Matching Bug:** When a new speaker/NPC appears in the game log, the backend performs a loose string-match lookup against the existing character library files. If the new character's *Name* happens to match ANY filename or card name inside the stored library, the engine automatically and permanently binds that character's image to the active speaker slot, completely ignoring unique ID segregation. Clearing the `data` folder of all existing characters is the only thing that stops this automatic false linking. 2. **Fallback Path Hijacking (SillyTavern Cache Leak):** When the local `data/avatars` directory is entirely cleared or empty, the server's asset router fails to return a clean empty state. Instead, it falls back to parsing legacy import directories. It actively targets and extracts raw images directly from the SillyTavern import/migration cache path, forcing broken or completely random historical avatar overlays onto empty/new speaker containers. The correct uploaded image momentarily flashes upon page refresh (`Ctrl + F5`), but is instantly overwritten by this broken asset retrieval loop. The bug bypasses Incognito sessions and standard IndexedDB/LocalStorage wipes because the faulty logic is hosted strictly within the backend's path-matching engine. --- ### Steps to Reproduce 1. Run the latest stable build of Marinara Engine with an existing library of character cards. 2. Start a new Game Mode session using a speaker or NPC whose Name matches a card in your storage. 3. Observe that the game instantly force-links the storage card's image to the active frame, overriding the local layout. 4. Clear the `data/avatars` folder completely and initialize a session again. 5. Observe the avatar container pulling and flashing random leftover images sourced straight from the SillyTavern import location. --- ### Expected Behavior The asset manager must enforce strict unique ID matching for image-to-character binding, preventing loose string name collisions. If an avatar folder or container is empty, the UI must strictly render a default placeholder or a transparent frame, instead of indexing and leaking images from the SillyTavern import cache. --- ### Environment * **Marinara Version:** Stable branch (Latest release regression) * **Deployment:** Local Node.js server / Native desktop app container * **Browser:** Chromium-based / Standalone UI
bsakaguchi 2026-10-21 06:01:07 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Sep 6, 2026):

Check the latest staging; we addressed this issue already:
https://github.com/Pasta-Devs/Marinara-Engine/issues/5862

<!-- gh-comment-id:5560419295 --> @SpicyMarinara commented on GitHub (Sep 6, 2026): Check the latest staging; we addressed this issue already: https://github.com/Pasta-Devs/Marinara-Engine/issues/5862
Author
Owner

@scavru commented on GitHub (Sep 7, 2026):

No, everything's the same. I updated to Release: v2.4.5 Build: 9bbee87Branch: staging. I imported over 2,000 cards from the tavern, and in a clean game without any characters, it pulled up a character card with the same name as a character in the game, but the character’s name was white instead of blue. Then, after closing and refreshing the page, it disappeared; I clicked “Generate,” and it reappeared in place of the generated avatar.

<!-- gh-comment-id:5571790342 --> @scavru commented on GitHub (Sep 7, 2026): No, everything's the same. I updated to Release: v2.4.5 Build: 9bbee87Branch: staging. I imported over 2,000 cards from the tavern, and in a clean game without any characters, it pulled up a character card with the same name as a character in the game, but the character’s name was white instead of blue. Then, after closing and refreshing the page, it disappeared; I clicked “Generate,” and it reappeared in place of the generated avatar.
Author
Owner

@SpicyMarinara commented on GitHub (Sep 7, 2026):

Owner: @SpicyMarinara (Codex). Investigating the remaining same-name Game NPC collision in draft #5935, including the latest reproduction after #5862.

<!-- gh-comment-id:5574382855 --> @SpicyMarinara commented on GitHub (Sep 7, 2026): Owner: @SpicyMarinara (Codex). Investigating the remaining same-name Game NPC collision in draft #5935, including the latest reproduction after #5862.
Author
Owner

@SpicyMarinara commented on GitHub (Sep 7, 2026):

Landed on staging in #5935 after the full regression matrix and CodeRabbit review passed. Included focused regression coverage for the reported behavior; main is unchanged.

<!-- gh-comment-id:5575779102 --> @SpicyMarinara commented on GitHub (Sep 7, 2026): Landed on staging in #5935 after the full regression matrix and CodeRabbit review passed. Included focused regression coverage for the reported behavior; main is unchanged.
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#3247
No description provided.