[GH-ISSUE #3378] [Issue]: Command list is wrapped in a literal <commands> XML tag even when section wrapping is set to None #1826

Closed
opened 2026-10-21 05:43:02 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @kolacheee on GitHub (Jul 8, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3378

Originally assigned to: @SpicyMarinara on GitHub.

What's wrong

When "prompt section wrapping" is set to None, every context block renders without XML tags — except the character-command list, which is still hard-wrapped in a literal <commands> … </commands> element. So with None you get bare, unwrapped status/memory/context blocks plus one incongruously XML-tagged command block.

How to reproduce (try it yourself)

  1. In a conversation chat, enable Character Commands (at least one command available).
  2. Set prompt section wrapping to None.
  3. Generate and inspect the assembled prompt (Peek Prompt / debug).

You'll see: the command reminder is still wrapped in <commands> … </commands>, while the status/context and memory blocks render unwrapped.
Expected: with None selected, the command list renders without the XML tags, like every other block.

Where it is

packages/server/src/services/generation/conversation-command-runtime.ts — the command-reminder builder hardcodes the tags: commandLines starts with a literal `<commands>` (line 204), and the matching </commands> is appended near line 321. The builder never receives wrapFormat and never calls wrapContent, so it ignores the None setting that every sibling block honors.

What's happening

Unlike the status/context and memory blocks — which go through wrapContent and therefore respect wrapFormat="none" — the command list literally string-concatenates the <commands> open/close tags.

Suggested fix

Thread wrapFormat into the command-reminder builder and wrap the body via wrapContent(body, "commands", wrapFormat) instead of hardcoding the tags, so None strips them and xml/markdown stay consistent with the rest of the prompt. (Reporter flagged this in passing while requesting relocate/suppress macros — filed as its own bug; see the related enhancement.)


AI-investigated against the current tree (v2.0.9); the hardcoded opening tag at line 204 read and confirmed. Please verify before fixing.

Originally created by @kolacheee on GitHub (Jul 8, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3378 Originally assigned to: @SpicyMarinara on GitHub. **What's wrong** When "prompt section wrapping" is set to **None**, every context block renders without XML tags — except the character-command list, which is still hard-wrapped in a literal `<commands>` … `</commands>` element. So with None you get bare, unwrapped status/memory/context blocks plus one incongruously XML-tagged command block. **How to reproduce (try it yourself)** 1. In a conversation chat, enable Character Commands (at least one command available). 2. Set prompt section wrapping to **None**. 3. Generate and inspect the assembled prompt (Peek Prompt / debug). **You'll see:** the command reminder is still wrapped in `<commands>` … `</commands>`, while the status/context and memory blocks render unwrapped. **Expected:** with None selected, the command list renders without the XML tags, like every other block. **Where it is** `packages/server/src/services/generation/conversation-command-runtime.ts` — the command-reminder builder hardcodes the tags: `commandLines` starts with a literal `` `<commands>` `` (line 204), and the matching `</commands>` is appended near line 321. The builder never receives `wrapFormat` and never calls `wrapContent`, so it ignores the None setting that every sibling block honors. **What's happening** Unlike the status/context and memory blocks — which go through `wrapContent` and therefore respect `wrapFormat="none"` — the command list literally string-concatenates the `<commands>` open/close tags. **Suggested fix** Thread `wrapFormat` into the command-reminder builder and wrap the body via `wrapContent(body, "commands", wrapFormat)` instead of hardcoding the tags, so None strips them and xml/markdown stay consistent with the rest of the prompt. (Reporter flagged this in passing while requesting relocate/suppress macros — filed as its own bug; see the related enhancement.) --- *AI-investigated against the current tree (v2.0.9); the hardcoded opening tag at line 204 read and confirmed. Please verify before fixing.*
bsakaguchi 2026-10-21 05:43:02 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Jul 8, 2026):

Addressed in #3388 and merged to staging.

<!-- gh-comment-id:4918159189 --> @SpicyMarinara commented on GitHub (Jul 8, 2026): Addressed in #3388 and merged to staging.
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#1826
No description provided.