mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #6208] Conversation mode renders {{user}} in a character's message as the character's own name #3461
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#3461
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 (Sep 14, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6208
Originally assigned to: @SpicyMarinara on GitHub.
In a Conversation chat,
{{user}}inside a character's message is displayed with the character's own name (or the literal "Assistant" when the chat has no character) instead of the user's name. The model receives the right text; only what is shown on screen is wrong.Found while investigating an active-persona report; re-verified on
stagingat14de2d1ad, and the same code is in v2.4.4.How to reproduce (try it yourself)
{{user}}. The quickest way without a model: give the character a greeting likeNice to meet you, {{user}}.and start a Conversation with it, or edit an existing character message to contain{{user}}.What you'll see: the message on screen reads "Nice to meet you, ." With no character in the chat it reads "Nice to meet you, Assistant." Peek Prompt shows the same message as "Nice to meet you, Alice."
What should happen:
{{user}}renders as the user's persona name (Alice), the way Roleplay messages already do.Where it is
At staging
14de2d1ad,packages/client/src/components/chat/ConversationMessage.tsx, themacroContextmemo at lines 333-345:userName: displayName(line 335) is the cause.displayName(lines 302-308) is the message author's label, so for any non-user message it isprimaryCharInfo?.name ?? "Assistant".{{user}}resolves fromuserName(packages/client/src/lib/chat-macros.ts,user: userName ?? persona?.name ?? "User"), so a character message substitutes the speaker's name. Thepersona.name: displayNameon line 337 is shadowed byuserNameand does not matter; the persona description/personality/backstory/appearance/scenario fields on the following lines still come from the real persona, so only the name macros are wrong:{{user}},{{userName}}, and the phonetic variants that fall back to the user name. The same context feeds the display-side regex scripts, so a Find/Replace using{{user}}matches the character name in Conversation mode too. The Roleplay equivalent (ChatMessage.tsx) passes the user's name asuserName, and the server (macro-context.ts) always uses the persona name. In v2.4.4 the same line is at 321.Suggested fix
In
ConversationMessage.tsx, build the macro context from the user's identity for every message:userName(andpersona.name) come from the current persona (personaInfo, or the message's stamped persona for user messages), not fromdisplayName. The message header keeps usingdisplayNamefor the author label. Everything else in the context can stay as is.Context
Verified on the running app with the API: a seeded assistant message containing
{{user}}rendered as "Assistant" in a chat with no characters, while the prompt preview rendered "Alice Active"; the with-character case follows from the same expression. Please verify before fixing.@SpicyMarinara commented on GitHub (Sep 14, 2026):
Implementation owner: @SpicyMarinara, assisted by Codex. Taking this in the assigned issue sweep. Following the decision in #6206 to retire global active personas; explicit chat selections and stored persona data will be preserved. A linked draft PR is being opened before implementation.
@SpicyMarinara commented on GitHub (Sep 14, 2026):
Fixed in #6212, merged to staging. Conversation now resolves {{user}} from the chat user identity while preserving the speaking character header and earlier user-message persona snapshots. For example, Bob Character saying “Hello {{user}}” in Alice Persona’s chat now displays “Hello Alice Persona.”
The issue was reproduced before the fix. Client/API regressions and the focused desktop Chromium, mobile Chromium, and mobile WebKit flow pass.