mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2162] [Issue]: Self-referential character-field macros resolve against the first character in multi-character groups #1072
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#1072
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 @Romuromylus on GitHub (Jun 4, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2162
Originally assigned to: @cha1latte on GitHub.
Summary
In a multi-character group, the legacy app resolved each character card field through a macro context bound to that specific character, so a self-referential macro such as
{{personality}}or{{description}}inside one character's field expanded to that same character's own value. The refactor renders character field values raw and macro-resolves the whole assembled section once against the global (first-character) macro context, so a bare self-reference inside a non-first character's field resolves against the first character.Expected behavior
A self-referential card macro inside a character's field resolves to that character's own field value, even when multiple characters are active.
Actual behavior
In a multi-character group, a bare unbracketed
{{personality}}/{{description}}inside a non-first character's field resolves against the first character's fields. The standard{{user}}/{{char}}macros and the per-character depth-prompt path are unaffected; the refactor's explicit[ ... ]bracket syntax is an opt-in workaround.Steps to reproduce
{{personality}}.Impact area
Environment
93555d4bRegression notes
Worked in legacy (main @
c49f1d95). main:packages/server/src/services/prompt/marker-expander.ts:154-160(resolveCharacterScopedMacros with per-character profile). refactor @93555d4b:src/engine/generation/prompt-assembly.ts:1126-1145(renderCharacters renders raw values) +:2870(section resolved against global macros). Narrow/edge-case; self-referential field macros in groups are uncommon and[ ]bracket scoping is available as a workaround.