[GH-ISSUE #3561] [Issue]: Game Mode NPC portrait prompts duplicate the character description #1926

Closed
opened 2026-10-21 05:43:53 +07:00 by bsakaguchi · 0 comments
Owner

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

Originally assigned to: @SpicyMarinara on GitHub.

Summary

Game Mode NPC portrait generation inserts the character description multiple times into the final positive image prompt. Depending on the selected style profile, either the complete description or its extracted visual traits are repeated.

Expected behavior

The resolved canonical NPC description should appear once in the final provider prompt while preserving all identity-critical visual details.

Actual behavior

The server merges identical request and metadata descriptions under different labels, preventing deduplication. The portrait compiler then prepends another canonical-description prefix after the normal prompt deduplication pass.

A single supplied description can therefore be repeated twice by the portrait builder. In the full Game Mode route, the earlier metadata/request merge can amplify the duplication further.

Steps to reproduce

  1. Enable Game Mode NPC portrait generation and image prompt review.
  2. Create or encounter an NPC with a non-empty canonical description, then trigger portrait generation.
  3. Inspect the positive portrait prompt and observe the repeated description or repeated visual traits.

Environment

  • Marinara Engine version: 2.2.1
  • Install type: source
  • OS + version: Not provided
  • Browser or app shell: Not provided

Logs, screenshots, or video

Diagnostic input:

auburn hair, green eyes, leather jacket

Before the fix, the server prompt builder included that exact input twice:

Required canonical NPC visual profile: auburn hair, green eyes, leather jacket.
...
Required canonical NPC visual profile from the GM-created game state: auburn hair, green eyes, leather jacket.

Diagnostic occurrence count: 2.

Additional context

The first duplication point is resolveNpcPortraitAppearance() in packages/server/src/routes/game.routes.ts. It labels the metadata description before comparing it with the request description, so identical values are treated as different strings.

The second is compileGameImagePrompt() in packages/server/src/services/game/game-asset-generation.ts. It prepends canonicalPrefix after the shared compiler has already processed a prompt containing the appearance.

The behavior is related to the canonical-description preservation work from #3321 and PR #3293. Commit 2f3bef60 added the post-compilation canonical prefix.

Implementation owner: @JurijPietrowicz.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @JurijPietrowicz on GitHub (Jul 13, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3561 Originally assigned to: @SpicyMarinara on GitHub. ## Summary Game Mode NPC portrait generation inserts the character description multiple times into the final positive image prompt. Depending on the selected style profile, either the complete description or its extracted visual traits are repeated. ## Expected behavior The resolved canonical NPC description should appear once in the final provider prompt while preserving all identity-critical visual details. ## Actual behavior The server merges identical request and metadata descriptions under different labels, preventing deduplication. The portrait compiler then prepends another canonical-description prefix after the normal prompt deduplication pass. A single supplied description can therefore be repeated twice by the portrait builder. In the full Game Mode route, the earlier metadata/request merge can amplify the duplication further. ## Steps to reproduce 1. Enable Game Mode NPC portrait generation and image prompt review. 2. Create or encounter an NPC with a non-empty canonical description, then trigger portrait generation. 3. Inspect the positive portrait prompt and observe the repeated description or repeated visual traits. ## Environment - Marinara Engine version: 2.2.1 - Install type: source - OS + version: Not provided - Browser or app shell: Not provided ## Logs, screenshots, or video Diagnostic input: ```text auburn hair, green eyes, leather jacket ``` Before the fix, the server prompt builder included that exact input twice: ```text Required canonical NPC visual profile: auburn hair, green eyes, leather jacket. ... Required canonical NPC visual profile from the GM-created game state: auburn hair, green eyes, leather jacket. ``` Diagnostic occurrence count: `2`. ## Additional context The first duplication point is `resolveNpcPortraitAppearance()` in `packages/server/src/routes/game.routes.ts`. It labels the metadata description before comparing it with the request description, so identical values are treated as different strings. The second is `compileGameImagePrompt()` in `packages/server/src/services/game/game-asset-generation.ts`. It prepends `canonicalPrefix` after the shared compiler has already processed a prompt containing the appearance. The behavior is related to the canonical-description preservation work from #3321 and PR #3293. Commit `2f3bef60` added the post-compilation canonical prefix. Implementation owner: @JurijPietrowicz. ## Template check - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:43:53 +07:00
  • closed this issue
  • added the
    in-pr
    label
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#1926
No description provided.