mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2886] [Issue]: Preset instructions contaminate context in impersonation mode #1469
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#1469
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 @WhatsUpJerks on GitHub (Jun 27, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2886
Originally assigned to: @SpicyMarinara on GitHub.
Summary
When using /impersonate in RP mode, the preset is still injected including any rules like "You are [char], respond only as [char]". Then the impersonate prompt is added at the end, saying "You are [user]", which causes LLMs to loop or get confused and respond inappropriately.
Expected behavior
Impersonation should not include conflicting system prompt instructions.
Actual behavior
Cross-contamination occurs
Steps to reproduce
Environment
Logs, screenshots, or video
Additional context
I think a reasonable fix is to just exclude the preset entirely when impersonating:
(assembler.ts):
Add a new flag for whether it's impersonation mode, then
if (input.impersonateMode && section.isMarker !== "true") continue;when assembling the system prompt from the preset, but I don't want to open a PR if this is a really stupid or inappropriate method so I'm leaving it to the experts to decide how to approach this.
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@SpicyMarinara commented on GitHub (Jun 28, 2026):
Ah, yes, I can see how presets may conflict with the impersonate command. Ditching the entire system prompt may result in subpar results, but there's no other easy way around it.
@SpicyMarinara commented on GitHub (Jun 28, 2026):
Fixed in the local staging branch: preset-driven impersonation now tells the prompt assembler to skip regular preset sections while preserving marker sections such as chat history and contextual markers. This prevents regular preset text like assistant-role instructions from conflicting with the final /impersonate instruction. Added a prompt regression for this path and the #2886 changelog note.\n\nValidation:\n- pnpm regression:prompt\n- pnpm --filter @marinara-engine/server lint
@WhatsUpJerks commented on GitHub (Jun 28, 2026):
Awesome, thank you! It's good to see that my idea was actually more or less the "best" way to handle it. Maybe I'll be brave enough to open a PR of my own someday.