[GH-ISSUE #7607] [Issue]: Include macro in user message is not expanded prior to being sent #4215

Closed
opened 2026-10-21 06:12:33 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @usagirei on GitHub (Oct 14, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7607

Originally assigned to: @SpicyMarinara on GitHub.

Summary

{{include}} macro is not expanded when sent from a user message

Expected behavior

Macro gets expanded, and the resolved value is sent and stored with the user message, just like random and the others

Actual behavior

Similar in essence to both #7212 and #7585

The include macro is not expanded, and is then stored as-is in the message table
however in this scenario, it will still show as {{include::the entry}} in the chat log
It is then resolved only when sent to the model, causing it to potentially resolve with different seeds when random is involved, or the included entry content changes between assistant messages

Steps to reproduce

  1. Include a Lorebook with a test entry with the content Random Number: {{random:0:100}}, and Send a message with {{include::The Entry Name}}
  2. The raw include macro is sent, instead of the message with the resolved macro value
  3. Subsequent assistant messages will get a potentially different context every time in chat history

Environment

  • Marinara Engine version: Release: v2.5.0 | Build: c55d563 | Staging
  • Install type: Source
  • OS + version: Fedora 44
  • Browser or app shell: Firefox

Logs, screenshots, or video

Image
cat g%4Db%44l%4Dexr%53sop%50%58%55b%44gsv.json | jq '.[].content'
"Debug Assistant has joined the chat."
"Respond with: {{include::Test}}"
"Random Number: 4"
"again"
"Random Number: 7"

Additional context

Related:

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 @usagirei on GitHub (Oct 14, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7607 Originally assigned to: @SpicyMarinara on GitHub. ## Summary <!-- What is wrong in one or two sentences? --> {{include}} macro is not expanded when sent from a user message ## Expected behavior <!-- What should have happened? --> Macro gets expanded, and the resolved value is sent and stored with the user message, just like random and the others ## Actual behavior Similar in essence to both #7212 and #7585 The include macro is not expanded, and is then stored as-is in the message table however in this scenario, it will still show as {{include::the entry}} in the chat log It is then resolved only when sent to the model, causing it to potentially resolve with different seeds when random is involved, or the included entry content changes between assistant messages <!-- What happened instead? --> ## Steps to reproduce 1. Include a Lorebook with a test entry with the content `Random Number: {{random:0:100}}`, and Send a message with `{{include::The Entry Name}}` 2. The raw include macro is sent, instead of the message with the resolved macro value 3. Subsequent assistant messages will get a potentially different context every time in chat history ## Environment - Marinara Engine version: Release: v2.5.0 | Build: c55d563 | Staging - Install type: Source - OS + version: Fedora 44 - Browser or app shell: Firefox ## Logs, screenshots, or video <!-- Paste relevant logs and add screenshots when possible --> <img width="436" height="503" alt="Image" src="https://github.com/user-attachments/assets/34695a8b-d51a-4d14-827b-f2ae36be5c7e" /> ``` cat g%4Db%44l%4Dexr%53sop%50%58%55b%44gsv.json | jq '.[].content' "Debug Assistant has joined the chat." "Respond with: {{include::Test}}" "Random Number: 4" "again" "Random Number: 7" ``` ## Additional context Related: * #7212 * #7585 <!-- Optional: related issue links, temporary workaround, etc. --> ## 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:12:33 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@SpicyMarinara commented on GitHub (Oct 14, 2026):

Fixed on staging by #7615: Send, Post only and /send now save {{include::…}} expanded, with the entry's own macros filled in once. Game turns get the same expansion in the /send follow-up PR (fix/send-followups).

<!-- gh-comment-id:6169274143 --> @SpicyMarinara commented on GitHub (Oct 14, 2026): Fixed on staging by #7615: Send, Post only and /send now save {{include::…}} expanded, with the entry's own macros filled in once. Game turns get the same expansion in the /send follow-up PR (fix/send-followups).
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#4215
No description provided.