[GH-ISSUE #677] [Issue]: <context> and <commands> tags leak into user turn in Conversation mode #318

Closed
opened 2026-10-20 17:27:36 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Faird1 on GitHub (May 11, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/677

Summary

In Conversation mode, the engine's injected <context> and <commands> XML tags appear to leak into the user message turn, causing the AI to perceive them as user-sent content rather than as silent system instructions.

Expected behavior

<context> and <commands> tags should be injected into the system prompt only and remain fully transparent — the AI should have no awareness of them as part of the conversation.

Actual behavior

The AI (Professor Mari) explicitly referenced the injected tags in her response, stating that the user had "sent" her <context> and <commands> tags — which the user never typed. The user cannot see these tags in the UI at all, confirming the leak is on the backend injection side.

Steps to reproduce

  1. Open a chat with Professor Mari in Conversation mode
  2. Send any regular message
  3. Observe that Mari's response references <context> and <commands> XML tags as if they were written by the user

Environment

  • Marinara Engine version: v1.5.9
  • Install type: Termux
  • OS + version: Android 16 QPR 2 (BP4A.251205.006), Project InfinityX 3.10
  • Browser or app shell: Native APK (from releases)

Logs, screenshots, or video

(sorry for Russian, but yeah)
Image

Additional context

The tags are invisible to the user in the UI — only the model receives them, which confirms this is a backend injection placement issue. The tags are likely being appended to the user turn instead of (or in addition to) the system prompt.

Originally created by @Faird1 on GitHub (May 11, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/677 ## Summary In Conversation mode, the engine's injected `<context>` and `<commands>` XML tags appear to leak into the user message turn, causing the AI to perceive them as user-sent content rather than as silent system instructions. ## Expected behavior `<context>` and `<commands>` tags should be injected into the system prompt only and remain fully transparent — the AI should have no awareness of them as part of the conversation. ## Actual behavior The AI (Professor Mari) explicitly referenced the injected tags in her response, stating that the user had "sent" her `<context>` and `<commands>` tags — which the user never typed. The user cannot see these tags in the UI at all, confirming the leak is on the backend injection side. ## Steps to reproduce 1. Open a chat with Professor Mari in Conversation mode 2. Send any regular message 3. Observe that Mari's response references `<context>` and `<commands>` XML tags as if they were written by the user ## Environment - Marinara Engine version: v1.5.9 - Install type: Termux - OS + version: Android 16 QPR 2 (BP4A.251205.006), Project InfinityX 3.10 - Browser or app shell: Native APK (from releases) ## Logs, screenshots, or video (sorry for Russian, but yeah) <img width="1080" height="1502" alt="Image" src="https://github.com/user-attachments/assets/66f01466-1a88-46e2-ab34-19a28b936f80" /> ## Additional context The tags are invisible to the user in the UI — only the model receives them, which confirms this is a backend injection placement issue. The tags are likely being appended to the user turn instead of (or in addition to) the system prompt.
bsakaguchi 2026-10-20 17:27:36 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@SpicyMarinara commented on GitHub (May 11, 2026):

Model's skill issue: all the newer models recognize XML tags as instructions. This is an intended design. They are in the last user message, since otherwise the model forgets to use them if the conversation goes on too long; I haven't had any issue with models recognizing them as that, especially since we specify what they are.

Here are your optional, hidden commands you may use if you wish to, but only when they genuinely fit the conversation …

You have a toggle to disable them if you don't want to send them to the model (in Chat Settings -> Commands). I can move to the system message, but it only applies to the most recent messages and can be skipped if we do that, so I would rather avoid it.

<!-- gh-comment-id:4419310259 --> @SpicyMarinara commented on GitHub (May 11, 2026): Model's skill issue: all the newer models recognize XML tags as instructions. This is an intended design. They are in the last user message, since otherwise the model forgets to use them if the conversation goes on too long; I haven't had any issue with models recognizing them as that, especially since we specify what they are. ``` Here are your optional, hidden commands you may use if you wish to, but only when they genuinely fit the conversation … ``` You have a toggle to disable them if you don't want to send them to the model (in Chat Settings -> Commands). I can move <context> to the system message, but it only applies to the most recent messages and can be skipped if we do that, so I would rather avoid it.
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#318
No description provided.