[GH-ISSUE #3379] [Feature]: Add relocate/suppress macros for auto-inserted conversation contexts (memories, status/time, emoji-react, command list) #1827

Closed
opened 2026-10-21 05:43:03 +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/3379

Originally assigned to: @SpicyMarinara on GitHub.

What's being requested

Persona and character info can be placed/suppressed with macros — use the macro and the automatic insertion is skipped (no duplication). Several other auto-inserted conversation-mode context blocks have no such macro, so you can't relocate them or turn them off — and with section wrapping set to None they dump into the raw system prompt with nothing separating them. Add macros with the same "using the macro suppresses the auto-insert" contract for:

  • Conversation memories — "Things you must remember from past conversations: [Week of 08.06.2026 – 14.06.2026] …"
  • Chat status / context — "Your current status: online and active."; "{{user}}'s status: active."; "The current time and date: 10:24, 08.07.2026."
  • Emoji-react rules
  • Command list (this one also has a standalone bug where it's wrapped in <commands> even when wrapping is None — filed separately)

(Lorebook already has a marker for preset mode; it's only bypassed in conversation mode, so a conversation-mode lorebook macro would round this out.)

Why

When section wrapping is None, a lot of the automatic conversation context is dumped into the raw system prompt with no wrapping and blends together. Blocks that have macros can be controlled (placed/suppressed); these blocks don't have macros, so they can't be — you can neither separate them, move them, nor remove them.

Where it is

These blocks are built outside the preset/marker pipeline, so they can't reuse the persona/character suppression directly:

  • memories — packages/server/src/services/generation/conversation-history-runtime.ts
  • status/time context — packages/server/src/services/generation/conversation-context-block.ts
  • emoji-react rules — packages/server/src/routes/generate.routes.ts (~1753-1762)
  • command list — packages/server/src/services/generation/conversation-command-runtime.ts

The marker registry (for reference on how existing markers like persona/lorebook are defined) is packages/server/src/services/prompt/marker-expander.ts:113-132; lorebook's marker is at marker-expander.ts:311-376.

Suggested approach

Add optional conversation-mode macros (e.g. {{memories}}, {{context}}/{{status}}, {{commands}}, {{reactRules}}) that, when present in the prompt text, expand in place and suppress the corresponding auto-insert. Since conversation mode has no marker-expansion pipeline, implement suppression by scanning the resolved prompt for the token (a deterministic "present" flag) and skipping the auto-append — the same deterministic-flag approach the assembler already uses for chat_summary (assembler.ts:362/380-387/524), and the same fix direction recommended for the persona/character duplication bug. Pair the {{commands}} macro with the "command list ignores wrapFormat=none" fix.


AI-investigated against the current tree (v2.0.9). Builder locations identified from a code sweep — treat the exact line numbers as pointers to confirm. Filed as an enhancement per the reporter's framing.

Originally created by @kolacheee on GitHub (Jul 8, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3379 Originally assigned to: @SpicyMarinara on GitHub. **What's being requested** Persona and character info can be placed/suppressed with macros — use the macro and the automatic insertion is skipped (no duplication). Several other auto-inserted **conversation-mode** context blocks have **no** such macro, so you can't relocate them or turn them off — and with section wrapping set to **None** they dump into the raw system prompt with nothing separating them. Add macros with the same "using the macro suppresses the auto-insert" contract for: - **Conversation memories** — "Things you must remember from past conversations: [Week of 08.06.2026 – 14.06.2026] …" - **Chat status / context** — "Your current status: online and active."; "{{user}}'s status: active."; "The current time and date: 10:24, 08.07.2026." - **Emoji-react rules** - **Command list** (this one also has a standalone bug where it's wrapped in `<commands>` even when wrapping is None — filed separately) (Lorebook already has a marker for preset mode; it's only bypassed in conversation mode, so a conversation-mode lorebook macro would round this out.) **Why** When section wrapping is None, a lot of the automatic conversation context is dumped into the raw system prompt with no wrapping and blends together. Blocks that have macros can be controlled (placed/suppressed); these blocks don't have macros, so they can't be — you can neither separate them, move them, nor remove them. **Where it is** These blocks are built **outside** the preset/marker pipeline, so they can't reuse the persona/character suppression directly: - memories — `packages/server/src/services/generation/conversation-history-runtime.ts` - status/time context — `packages/server/src/services/generation/conversation-context-block.ts` - emoji-react rules — `packages/server/src/routes/generate.routes.ts` (~1753-1762) - command list — `packages/server/src/services/generation/conversation-command-runtime.ts` The marker registry (for reference on how existing markers like persona/lorebook are defined) is `packages/server/src/services/prompt/marker-expander.ts:113-132`; lorebook's marker is at `marker-expander.ts:311-376`. **Suggested approach** Add optional conversation-mode macros (e.g. `{{memories}}`, `{{context}}`/`{{status}}`, `{{commands}}`, `{{reactRules}}`) that, when present in the prompt text, expand in place and **suppress** the corresponding auto-insert. Since conversation mode has no marker-expansion pipeline, implement suppression by scanning the resolved prompt for the token (a deterministic "present" flag) and skipping the auto-append — the same deterministic-flag approach the assembler already uses for `chat_summary` (`assembler.ts:362/380-387/524`), and the same fix direction recommended for the persona/character duplication bug. Pair the `{{commands}}` macro with the "command list ignores wrapFormat=none" fix. --- *AI-investigated against the current tree (v2.0.9). Builder locations identified from a code sweep — treat the exact line numbers as pointers to confirm. Filed as an enhancement per the reporter's framing.*
bsakaguchi 2026-10-21 05:43:03 +07:00
Author
Owner

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

Addressed in #3388 and merged to staging.

<!-- gh-comment-id:4918159204 --> @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#1827
No description provided.