mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2989] [Issue]: Retry persona resolution falls back to the globally-active persona in game mode, mismatching the original generation #1564
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1564
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kolacheee on GitHub (Jun 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2989
Originally assigned to: @SpicyMarinara on GitHub.
What's wrong
The retry-agents route resolves persona by falling back to whatever persona is globally active when the chat has no persona set — even in game mode. The main generate route deliberately suppresses this fallback for game mode ("persona must be explicitly selected in the setup wizard"). So a game-mode chat with no chat.personaId but some unrelated globally-active persona will, on agent retry, inject that wrong persona into agent context (persona block, illustrator references, sprite/expression targeting, persona sprite persistence) — a persona that was never part of the original game generation.
How to reproduce (try it yourself)
You'll see: the retry injects the globally-active persona — a non-"User" persona block, that personaId targeted for sprite expressions, and it passed to the illustrator references.
Expected: no persona is used on retry (matching the original game generation), exactly as the main route does.
Where it is
packages/server/src/routes/generate/retry-agents-route.ts:441-443(resolvePersonaContext, called at line 549; consumed at 665-677, 689-691, 700, 776-803). Canonical contrast:packages/server/src/routes/generate.routes.ts:1767-1769.What's happening
resolvePersonaContextomits thechatMode !== "game"guard the main route applies. It mirrors only the first half of the main route's resolution (prefer chat.personaId) but not the game-mode fallback suppression.Suggested fix
Gate the active-persona fallback on game mode inside
resolvePersonaContext, deriving chatMode from thechatargument the function already receives. Replace lines 441-443:The function signature and single call site are untouched. No regression: for conversation/roleplay/visual_novel the guard is always true so the happy path is unchanged; for game mode with chat.personaId set, the first branch resolves before the guard. (Note: the dry-run preview route at dry-run-route.ts:768-770 has the identical missing guard — separate read-only path, worth a follow-up but out of scope here.)
AI-investigated against v2.0.6; cited lines read and confirmed. Please verify before fixing.
@SpicyMarinara commented on GitHub (Jun 29, 2026):
Fixed in merged staging PR #3004.