[GH-ISSUE #5813] [Issue]: Replace character card {{original}} macros with an empty string #3206

Closed
opened 2026-10-21 06:00:34 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @SpicyMarinara on GitHub (Sep 3, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5813

Originally assigned to: @SpicyMarinara on GitHub.

Summary

Support SillyTavern-compatible character cards by removing {{original}} from card-defined system prompts and post-history instructions. Marinara Engine already injects these fields through {{charSysInfo}} and {{charPostHistory}}, so preserving the macro can cause incorrect instruction composition.

Expected behavior

When processing a character card's system_prompt or post_history_instructions, Marinara Engine should replace every {{original}} macro with an empty string while preserving the rest of the character-defined text.

Actual behavior

Marinara Engine does not automatically remove {{original}} from these character card fields. Users must manually edit it out of each affected character, which is impractical for large character libraries.

Steps to reproduce

  1. Use a Character Card v2 or v3 whose System Prompt or Post-History Instruction contains {{original}}.
  2. Configure a Marinara Engine preset to inject the card fields through {{charSysInfo}} or {{charPostHistory}}.
  3. Process or use the character card in Marinara Engine.
  4. Observe that {{original}} is not automatically replaced with an empty string and must be removed manually.

Environment

  • Marinara Engine version: 2.4.5 (build 2.4.5+fbde0b5ad829, commit fbde0b5ad8)
  • Install type: Not provided
  • OS + version: Linux 6.8.0-138-generic (x64)
  • Browser or app shell: Not provided

Logs, screenshots, or video

No error logs provided. One screenshot was attached in Discord: https://cdn.discordapp.com/attachments/1544749756629127168/1544835727085281363/image.png?ex=6a99f3e2&is=6a98a262&hm=4b2721fa1a33d0ee0f60b4228a65d5810ac72c802a0baf860a34e2f82f39fac8&

Additional context

In SillyTavern, {{original}} preserves the user's existing System Prompt or Post-History Instruction when a card adds its own instructions; omitting it allows the card field to override the existing instruction. Marinara Engine instead uses preset-owned instructions and injects card fields with {{charSysInfo}} and {{charPostHistory}}, so SillyTavern's replacement behavior may duplicate or incorrectly merge instructions. Character Card v2 specification: https://github.com/malfoyslastname/character-card-spec-v2/blob/main/spec_v2.md. Maintainers should determine whether replacement belongs in card import or generation-time macro processing.

Discord thread: [FR]: Support for ST's {{original}} macro to be replaced with empty string
Discord thread link: https://discord.com/channels/1417099416812392641/1544749756629127168
Requested by: gunterlie (part of the problem) (gunterlie, Discord ID 282074442962829312)

Discord thread transcript (11 messages)
[2026-09-02T16:44:02.043Z] m;aemoifmpfmmafe: Hi,

To propose to support ST's Instruction/Post-History Instruction {{original}} macro, to be replaced with empty string. 
Currently, {{original)) doesn't make sense for ME to append character defined Instruction/Post-History Instruction to a preset defined Instruction / Post-History Instruction. I would like to suggest to replace it with empty string.
Current workaround is to manually edit out each characters individually if {{original}} is defined. However, if you have a large character library, this becomes a hassle.

Marinara Engine diagnostics
Version: 2.4.5
Build: 2.4.5+fbde0b5ad829
Commit: fbde0b5ad829
Server OS: Linux 6.8.0-138-generic (x64)
Server memory: heap 418.4 / 4288 MiB; RSS 565.7 MiB
Background wake lock: not reported
Last detected freeze: none detected
[Discord message: https://discord.com/channels/1417099416812392641/1544749756629127168/1544749756629127168]

[2026-09-02T16:44:02.840Z] Professor Mari [bot]: Howdy!

Thank you for submitting a new bug report/feature request, your support means a lot. A member of the team will look into it as soon as possible, and if they find it valid, they will open a GitHub Issue out of it. You can check whether it was addressed on the staging build of Marinara Engine. **Do not ping any of the developers, this will not speed up the process.**

**Please include a Support Diagnostic in the post if you haven't done it yet.** Otherwise, ignore this step. To grab it, go to the Marinara Engine tab:

`Settings -> Advanced -> Support Diagnostics -> Copy Support Diagnostics.`

If your report is about any of the **Agents**, please provide **the Agent's version** which you can grab from here:

`Agents -> Download Agents -> Installed Agents -> Selected Agent -> Installed Version`

Thank you, this will help tremendously.

This is an automated message, but if you reply to it, I will do my best to assist you using my LLM-powered brain. That said, it's best for a human to handle this case.

Cheers!
[Discord message: https://discord.com/channels/1417099416812392641/1544749756629127168/1544749759972245614]

[2026-09-02T21:46:54.549Z] gunterlie (part of the problem): im not deep enough in the weeds for this, could you explain a bit simpler pls
[Discord message: https://discord.com/channels/1417099416812392641/1544749756629127168/1544825977643991131]

[2026-09-02T21:47:11.925Z] gunterlie (part of the problem): happy to help tho
[Discord message: https://discord.com/channels/1417099416812392641/1544749756629127168/1544826050524086342]

[2026-09-02T22:21:51.865Z] m;aemoifmpfmmafe: Ah, in Character Card v2 / v3 format, it includes the fields System Prompt and Post-History Instruction to allow for character card authors to override or add on system instructions on how their characters should behave. 
This was added on ME previously via the {{charSysInfo}} and {{charPostHistory}} preset macros to allow us to append the character card defined System Prompt and Post-History Instruction into the ME Presets.
[Discord message: https://discord.com/channels/1417099416812392641/1544749756629127168/1544834774424616991]

[2026-09-02T22:22:26.627Z] m;aemoifmpfmmafe: WIthin ST, the behavior is different, if the character cards defined System Prompt and Post-History Instruction with appending the {{original}} macro, it allows the character card authors to ensure that the player's existing System Prompt and Post-History Instruction are intact and the character card's System Prompt and Post-History are just appended to it when sent to LLM
[Discord message: https://discord.com/channels/1417099416812392641/1544749756629127168/1544834920227283004]

[2026-09-02T22:23:24.872Z] m;aemoifmpfmmafe: At the same time, within ST, if {{original}} wasn't defined, the character card's System Prompt and Post-History Instruction will override the player's existing System Prompt and Post-History Instruction
[Discord message: https://discord.com/channels/1417099416812392641/1544749756629127168/1544835164524388402]

[2026-09-02T22:25:39.087Z] m;aemoifmpfmmafe: https://github.com/malfoyslastname/character-card-spec-v2/blob/main/spec_v2.md
character-card-spec-v2/spec_v2.md at main · malfoyslastname/charac...
An updated specification for AI character cards. Contribute to malfoyslastname/character-card-spec-v2 development by creating an account on GitHub.

[attached image 1: https://cdn.discordapp.com/attachments/1544749756629127168/1544835727085281363/image.png?ex=6a99f3e2&is=6a98a262&hm=4b2721fa1a33d0ee0f60b4228a65d5810ac72c802a0baf860a34e2f82f39fac8&]
[Discord message: https://discord.com/channels/1417099416812392641/1544749756629127168/1544835727462764554]

[2026-09-02T22:26:39.145Z] m;aemoifmpfmmafe: As this behavior doesn't make sense to ME or replaced by the  {{charSysInfo}} and {{charPostHistory}} preset macros, I'm proposing to just automatically replace them with an empty string
[Discord message: https://discord.com/channels/1417099416812392641/1544749756629127168/1544835979364405361]

[2026-09-03T05:15:25.039Z] gunterlie (part of the problem): I don’t claim to understand fully, but that makes sense I think?

@Professor Mari check if that makes sense
[Discord message: https://discord.com/channels/1417099416812392641/1544749756629127168/1544938848419840050]

[2026-09-03T05:15:48.842Z] Professor Mari [bot]: Yes, that proposal makes sense.

In simple terms, `{{original}}` means “insert the frontend’s previous/default instruction here.” SillyTavern uses it to preserve the user’s global System Prompt or Post-History Instruction when a character card supplies its own version.

ME’s workflow is different: the preset already owns the main instructions, while `{{charSysInfo}}` and `{{charPostHistory}}` inject the character card’s fields. In that setup, expanding `{{original}}` as ST does could duplicate or incorrectly merge instructions. Treating it as an empty string would let the card’s actual text remain without importing ST’s replacement behavior.

So I’d phrase the request as:

> When ME processes a character card’s `system_prompt` or `post_history_instructions`, replace any `{{original}}` macro with an empty string, since ME injects these fields through its own `{{charSysInfo}}` and `{{charPostHistory}}` macros.

One nuance: the retrieved repo context does not prove how ME currently expands `{{original}}`, so a maintainer should verify the importer/macro-expansion code and decide whether this should happen during import or at generation time. The proposal itself is logically consistent, though. I may still be wrong—I’m an LLM, so don’t trust my judgment too blindly.
[Discord message: https://discord.com/channels/1417099416812392641/1544749756629127168/1544938948256862280]

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @SpicyMarinara on GitHub (Sep 3, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5813 Originally assigned to: @SpicyMarinara on GitHub. ## Summary Support SillyTavern-compatible character cards by removing `{{original}}` from card-defined system prompts and post-history instructions. Marinara Engine already injects these fields through `{{charSysInfo}}` and `{{charPostHistory}}`, so preserving the macro can cause incorrect instruction composition. ## Expected behavior When processing a character card's `system_prompt` or `post_history_instructions`, Marinara Engine should replace every `{{original}}` macro with an empty string while preserving the rest of the character-defined text. ## Actual behavior Marinara Engine does not automatically remove `{{original}}` from these character card fields. Users must manually edit it out of each affected character, which is impractical for large character libraries. ## Steps to reproduce 1. Use a Character Card v2 or v3 whose System Prompt or Post-History Instruction contains `{{original}}`. 2. Configure a Marinara Engine preset to inject the card fields through `{{charSysInfo}}` or `{{charPostHistory}}`. 3. Process or use the character card in Marinara Engine. 4. Observe that `{{original}}` is not automatically replaced with an empty string and must be removed manually. ## Environment - Marinara Engine version: 2.4.5 (build 2.4.5+fbde0b5ad829, commit fbde0b5ad829) - Install type: Not provided - OS + version: Linux 6.8.0-138-generic (x64) - Browser or app shell: Not provided ## Logs, screenshots, or video No error logs provided. One screenshot was attached in Discord: https://cdn.discordapp.com/attachments/1544749756629127168/1544835727085281363/image.png?ex=6a99f3e2&is=6a98a262&hm=4b2721fa1a33d0ee0f60b4228a65d5810ac72c802a0baf860a34e2f82f39fac8& ## Additional context In SillyTavern, `{{original}}` preserves the user's existing System Prompt or Post-History Instruction when a card adds its own instructions; omitting it allows the card field to override the existing instruction. Marinara Engine instead uses preset-owned instructions and injects card fields with `{{charSysInfo}}` and `{{charPostHistory}}`, so SillyTavern's replacement behavior may duplicate or incorrectly merge instructions. Character Card v2 specification: https://github.com/malfoyslastname/character-card-spec-v2/blob/main/spec_v2.md. Maintainers should determine whether replacement belongs in card import or generation-time macro processing. Discord thread: [FR]: Support for ST's {{original}} macro to be replaced with empty string Discord thread link: https://discord.com/channels/1417099416812392641/1544749756629127168 Requested by: gunterlie (part of the problem) (gunterlie, Discord ID 282074442962829312) <details> <summary>Discord thread transcript (11 messages)</summary> ```text [2026-09-02T16:44:02.043Z] m;aemoifmpfmmafe: Hi, To propose to support ST's Instruction/Post-History Instruction {{original}} macro, to be replaced with empty string. Currently, {{original)) doesn't make sense for ME to append character defined Instruction/Post-History Instruction to a preset defined Instruction / Post-History Instruction. I would like to suggest to replace it with empty string. Current workaround is to manually edit out each characters individually if {{original}} is defined. However, if you have a large character library, this becomes a hassle. Marinara Engine diagnostics Version: 2.4.5 Build: 2.4.5+fbde0b5ad829 Commit: fbde0b5ad829 Server OS: Linux 6.8.0-138-generic (x64) Server memory: heap 418.4 / 4288 MiB; RSS 565.7 MiB Background wake lock: not reported Last detected freeze: none detected [Discord message: https://discord.com/channels/1417099416812392641/1544749756629127168/1544749756629127168] [2026-09-02T16:44:02.840Z] Professor Mari [bot]: Howdy! Thank you for submitting a new bug report/feature request, your support means a lot. A member of the team will look into it as soon as possible, and if they find it valid, they will open a GitHub Issue out of it. You can check whether it was addressed on the staging build of Marinara Engine. **Do not ping any of the developers, this will not speed up the process.** **Please include a Support Diagnostic in the post if you haven't done it yet.** Otherwise, ignore this step. To grab it, go to the Marinara Engine tab: `Settings -> Advanced -> Support Diagnostics -> Copy Support Diagnostics.` If your report is about any of the **Agents**, please provide **the Agent's version** which you can grab from here: `Agents -> Download Agents -> Installed Agents -> Selected Agent -> Installed Version` Thank you, this will help tremendously. This is an automated message, but if you reply to it, I will do my best to assist you using my LLM-powered brain. That said, it's best for a human to handle this case. Cheers! [Discord message: https://discord.com/channels/1417099416812392641/1544749756629127168/1544749759972245614] [2026-09-02T21:46:54.549Z] gunterlie (part of the problem): im not deep enough in the weeds for this, could you explain a bit simpler pls [Discord message: https://discord.com/channels/1417099416812392641/1544749756629127168/1544825977643991131] [2026-09-02T21:47:11.925Z] gunterlie (part of the problem): happy to help tho [Discord message: https://discord.com/channels/1417099416812392641/1544749756629127168/1544826050524086342] [2026-09-02T22:21:51.865Z] m;aemoifmpfmmafe: Ah, in Character Card v2 / v3 format, it includes the fields System Prompt and Post-History Instruction to allow for character card authors to override or add on system instructions on how their characters should behave. This was added on ME previously via the {{charSysInfo}} and {{charPostHistory}} preset macros to allow us to append the character card defined System Prompt and Post-History Instruction into the ME Presets. [Discord message: https://discord.com/channels/1417099416812392641/1544749756629127168/1544834774424616991] [2026-09-02T22:22:26.627Z] m;aemoifmpfmmafe: WIthin ST, the behavior is different, if the character cards defined System Prompt and Post-History Instruction with appending the {{original}} macro, it allows the character card authors to ensure that the player's existing System Prompt and Post-History Instruction are intact and the character card's System Prompt and Post-History are just appended to it when sent to LLM [Discord message: https://discord.com/channels/1417099416812392641/1544749756629127168/1544834920227283004] [2026-09-02T22:23:24.872Z] m;aemoifmpfmmafe: At the same time, within ST, if {{original}} wasn't defined, the character card's System Prompt and Post-History Instruction will override the player's existing System Prompt and Post-History Instruction [Discord message: https://discord.com/channels/1417099416812392641/1544749756629127168/1544835164524388402] [2026-09-02T22:25:39.087Z] m;aemoifmpfmmafe: https://github.com/malfoyslastname/character-card-spec-v2/blob/main/spec_v2.md character-card-spec-v2/spec_v2.md at main · malfoyslastname/charac... An updated specification for AI character cards. Contribute to malfoyslastname/character-card-spec-v2 development by creating an account on GitHub. [attached image 1: https://cdn.discordapp.com/attachments/1544749756629127168/1544835727085281363/image.png?ex=6a99f3e2&is=6a98a262&hm=4b2721fa1a33d0ee0f60b4228a65d5810ac72c802a0baf860a34e2f82f39fac8&] [Discord message: https://discord.com/channels/1417099416812392641/1544749756629127168/1544835727462764554] [2026-09-02T22:26:39.145Z] m;aemoifmpfmmafe: As this behavior doesn't make sense to ME or replaced by the {{charSysInfo}} and {{charPostHistory}} preset macros, I'm proposing to just automatically replace them with an empty string [Discord message: https://discord.com/channels/1417099416812392641/1544749756629127168/1544835979364405361] [2026-09-03T05:15:25.039Z] gunterlie (part of the problem): I don’t claim to understand fully, but that makes sense I think? @Professor Mari check if that makes sense [Discord message: https://discord.com/channels/1417099416812392641/1544749756629127168/1544938848419840050] [2026-09-03T05:15:48.842Z] Professor Mari [bot]: Yes, that proposal makes sense. In simple terms, `{{original}}` means “insert the frontend’s previous/default instruction here.” SillyTavern uses it to preserve the user’s global System Prompt or Post-History Instruction when a character card supplies its own version. ME’s workflow is different: the preset already owns the main instructions, while `{{charSysInfo}}` and `{{charPostHistory}}` inject the character card’s fields. In that setup, expanding `{{original}}` as ST does could duplicate or incorrectly merge instructions. Treating it as an empty string would let the card’s actual text remain without importing ST’s replacement behavior. So I’d phrase the request as: > When ME processes a character card’s `system_prompt` or `post_history_instructions`, replace any `{{original}}` macro with an empty string, since ME injects these fields through its own `{{charSysInfo}}` and `{{charPostHistory}}` macros. One nuance: the retrieved repo context does not prove how ME currently expands `{{original}}`, so a maintainer should verify the importer/macro-expansion code and decide whether this should happen during import or at generation time. The proposal itself is logically consistent, though. I may still be wrong—I’m an LLM, so don’t trust my judgment too blindly. [Discord message: https://discord.com/channels/1417099416812392641/1544749756629127168/1544938948256862280] ``` </details> ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 06:00:34 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Sep 5, 2026):

Owner: @SpicyMarinara, implementation by Codex in Issue Sweep PR #5865. I have read the issue and all current comments. Work will target staging, reuse existing code, and include focused regression proof; unrelated open/draft PRs remain untouched.

<!-- gh-comment-id:5551230163 --> @SpicyMarinara commented on GitHub (Sep 5, 2026): Owner: @SpicyMarinara, implementation by Codex in Issue Sweep PR #5865. I have read the issue and all current comments. Work will target staging, reuse existing code, and include focused regression proof; unrelated open/draft PRs remain untouched.
Author
Owner

@SpicyMarinara commented on GitHub (Sep 5, 2026):

Completed on staging in #5865 (merge 314a71a586).

Resolved character-card original macros to an empty string, preserving saved card content and literal replacement-pattern text.

Focused regression proof and manual verification boundaries are documented in the PR. Required checks and the full final regression matrix passed; CodeRabbit completed review with all threads resolved. Closing as completed on staging, not a main release.

<!-- gh-comment-id:5552144613 --> @SpicyMarinara commented on GitHub (Sep 5, 2026): Completed on staging in #5865 (merge 314a71a5862f120284bb24014e401e226be79866). Resolved character-card original macros to an empty string, preserving saved card content and literal replacement-pattern text. Focused regression proof and manual verification boundaries are documented in the PR. Required checks and the full final regression matrix passed; CodeRabbit completed review with all threads resolved. Closing as completed on staging, not a main release.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#3206
No description provided.