mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #5236] [Feature]: improved macro behavior for character and persona cards #2896
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#2896
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 @stclaire on GitHub (Aug 18, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5236
Originally assigned to: @SpicyMarinara on GitHub.
What problem does this solve?
The ability to have characters in a chat know about characters and/or personas aside from those that are added to the chat, without wasted tokens. This is useful for when you want the chat characters to have knowledge about another character but you don't want that other character to be a participant. This is especially useful for them to have knowledge of an additional persona, given that only a single persona can be added to a chat at a time.
The character card macro provides this, however it adds fields that aren't useful and therefore waste tokens. The persona card macro currently does not provide this at all. Please see details under "additional context" below.
(Apologies if this would have been better as a bug. I was torn between the feature request vs bug as it's half and half.)
Proposed solution
I think have both macros insert the card details, limited to the useful fields like are included for the cards that are added directly to the chat, at the location indicated by the lorebook entry (rather than inserting the character name there). I don't think there's much benefit to inserting just the name via this macro as the name could be added directly just as easily as adding the ID (but maybe there are use cases I haven't considered).
Alternatives considered
Alternatively, keep it in the "referenced characters" section, but maybe expose that in the preset editor, and ensure the persona details are added there as well, and reduce it to the useful fields. The nice thing with the other approach is this same behavior can be achieved via an outlet, so that approach gives a bit more flexibility.
Additional context
Using the {{21-character-card-ID}} macro in a lorebook entry results in the character name being inserted at the insertion point specified by the entry, and the card contents being inserted into a special "Referenced Characters" section. This section doesn't appear in the preset editor so cannot be configured. More problematically, the absolute entire card contents are included, not just what is included under for the characters added to a chat normally (such as <character_id>, , <character_version>, <creator_notes>, and ).
Using the {{persona-21-character-card-ID}} macro in a lorebook entry results in the persona name being inserted at the insertion point specified by the entry (just as with the character card macro) but the card contents itself does not seem to be inserted anywhere.
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 (Aug 19, 2026):
Why not just use lorebooks then?
@stclaire commented on GitHub (Aug 19, 2026):
Lorebook entries are where I place the macro, in order for it to be triggered as needed, such as by keyword of the character name in chat. However, without the macro, I have to copy all the contents from the character/persona card into the lorebook entry and update both anytime I want to update the character/persona. If I could inject via the macro, then it would stay in sync automatically.
(I don't have permission to reopen the issue, so hopefully you see this reply 🙂)
@SpicyMarinara commented on GitHub (Aug 19, 2026):
You don't have to write those manually, you can use macros for that. They resolve in lorebook entries just fine.
https://github.com/Pasta-Devs/Marinara-Engine/blob/main/docs/prompts/macros.md
@stclaire commented on GitHub (Aug 19, 2026):
I am using the macros. I'm reporting that the persona one only resolves to the persona name and does not inject the persona card data at all, and while the character one does inject the card data, it injects fields that are not meant for the AI to consume and also it injects them in a section of the prompt that cannot be modified as opposed to where the lorebook entry sets the injection (it only injects the character name at that location).
@SpicyMarinara commented on GitHub (Aug 19, 2026):
It works perfectly fine for me. I am using it myself in lorebooks and it injects my entire persona info.
For specific parts of your character card, just use these.
@stclaire commented on GitHub (Aug 19, 2026):
It's not for the currently selected persona or character, it's for one that has not been added to the chat. Using the {{persona-21character-card-ID}} and {{21-character-card-ID}} macros.
Checking again just now to make screenshots though, I discovered that when the persona card macro is used and no character card macro is used, the persona does actually get inserted and behaves exactly like the character card macro now, but filling a "referenced personas" section. But when both "referenced characters" and "referenced personas" exist, only "referenced characters" is created.
I don't think the field specific macros have a way to refer to a character or persona card that is not added to the chat as a normal character/persona, only the currently active one in chat, but if there's a way please let me know.
Here are some screenshots showing with just a persona referenced and where it is injected and how the sections don't show in the preset editor.
@SpicyMarinara commented on GitHub (Aug 19, 2026):
Pookie, you can turn those personas into character cards with one click and use character macros for those.
@stclaire commented on GitHub (Aug 19, 2026):
True, but then one has to manually keep them in sync when any update is made. And it's definitely unexpected that the referenced persona stops working when a character is referenced at the same time, so I imagine that would lead to users expecting a persona to be injected and then struggling to figure out why it wasn't. I thought the macro was broken altogether until I tried just a referenced persona to test and grab the screenshots for this. If you don't want to make both work at the same time, then maybe at least add something to the macro docs to indicate that the persona one won't inject the card if character cards are also injected, just to save folks wondering what's going on?
It also doesn't address the inability to set where the card info is inserted, or restrict it to just the fields that are relevant for the AI (the ones that appear for the characters or persona actually active in the chat). Alternatively, maybe add macros for the specific fields (like the macros you mentioned above) but for a given character or persona card, maybe something like {{description-persona-21character-card-ID}} and {{description-21-character-card-ID}} etc...? That would be the most flexible, though that is a lot of macros to add.
In any case, thanks very much for considering.