[GH-ISSUE #3438] [Feature]: Placement macros for the remaining auto-inserted prompt blocks (conversation history, lorebook before/after, emoji/sticker reply rules) #1860

Closed
opened 2026-10-21 05:43:20 +07:00 by bsakaguchi · 0 comments
Owner

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

Originally assigned to: @kolacheee on GitHub.

What problem does this solve?

The new Conversation-mode preset macros (e.g. {{char_about}}, {{persona_about}}, {{reactRules}}, {{commands}}, {{status}}, {{context}}, {{memories}}, …) let users place and customize individual auto-inserted prompt blocks from their preset — reposition them, wrap them in {{#if}}, or omit them. This has made Conversation prompts far more modular and controllable.

But several other things the engine inserts into the prompt automatically still have no macro, so they can't be repositioned, wrapped, or conditionally included from a custom preset. The two most requested:

  • Conversation history — the running message transcript block.
  • Lorebook injections — ideally the position-based buckets separately (the "before" and "after" placements), since lorebook entries have before/after-char positions.

Users building fully modular prompts want the same control over these that the existing macros already give for participant profiles, memories, rules, etc.

Proposed solution

Add placement macros for the remaining automatic prompt insertions, following the same convention as the existing set (when the macro appears in the preset, render the content there — and suppress the corresponding automatic insertion so it isn't duplicated):

  • A conversation history macro (the chat transcript block).
  • Lorebook placement macro(s) — split into before and after (position) buckets if feasible, so each can be placed independently.
  • A custom-emoji / sticker "reply" advertisement macro — the react rules are already relocatable via {{reactRules}}, but the reply advertisement ("You can use custom emojis in your reply by writing their name between colons…", and the sticker equivalent) has no macro and is always force-appended. There's a clear parity gap: a preset can move the react rules but not the emoji/sticker reply rules. A {{emojis}}/{{stickers}} (or {{replyRules}}) macro, gating the force-append the way {{reactRules}} already gates its block, would close it. (This one is a concrete, low-effort parity fix — it mirrors the existing reactRules slot; the react force-append is gated at generate.routes.ts:1892, while the emoji/sticker reply advertisements are appended unconditionally in packages/server/src/routes/generate/conversation-custom-assets.ts:316/:369.)
  • Any other currently-fixed auto-insertions that lack a macro and are feasible to expose (e.g. summaries / daily history, the current date-time block, etc.).

Alternatives considered

  • Preset section ordering controls — partial: they can reorder fixed sections but don't allow inline wrapping ({{#if}}, custom surrounding text) around the block the way a placement macro does.
  • Leaving these as fixed automatic insertions — the status quo this request addresses.

Additional context

Follow-up to the new Conversation macros. The reporter notes they're not certain what's technically feasible and would appreciate whatever subset can be exposed. Filed alongside the conversation-macro bug reports #3435 ({{#if}} + macros), #3436 (auto-block suppression), and #3437 (macro docs). In particular, any new placement macro should suppress its auto-inserted counterpart the same way the existing relocation macros do — see #3436.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @kolacheee on GitHub (Jul 10, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3438 Originally assigned to: @kolacheee on GitHub. ## What problem does this solve? The new Conversation-mode preset macros (e.g. `{{char_about}}`, `{{persona_about}}`, `{{reactRules}}`, `{{commands}}`, `{{status}}`, `{{context}}`, `{{memories}}`, …) let users **place and customize individual auto-inserted prompt blocks** from their preset — reposition them, wrap them in `{{#if}}`, or omit them. This has made Conversation prompts far more modular and controllable. But several other things the engine inserts into the prompt **automatically** still have no macro, so they can't be repositioned, wrapped, or conditionally included from a custom preset. The two most requested: - **Conversation history** — the running message transcript block. - **Lorebook injections** — ideally the position-based buckets separately (the "before" and "after" placements), since lorebook entries have before/after-char positions. Users building fully modular prompts want the same control over these that the existing macros already give for participant profiles, memories, rules, etc. ## Proposed solution Add placement macros for the remaining automatic prompt insertions, following the same convention as the existing set (when the macro appears in the preset, render the content there — and suppress the corresponding automatic insertion so it isn't duplicated): - A **conversation history** macro (the chat transcript block). - **Lorebook** placement macro(s) — split into **before** and **after** (position) buckets if feasible, so each can be placed independently. - A **custom-emoji / sticker "reply" advertisement** macro — the react rules are already relocatable via `{{reactRules}}`, but the *reply* advertisement ("You can use custom emojis in your reply by writing their name between colons…", and the sticker equivalent) has **no macro** and is always force-appended. There's a clear parity gap: a preset can move the react rules but not the emoji/sticker reply rules. A `{{emojis}}`/`{{stickers}}` (or `{{replyRules}}`) macro, gating the force-append the way `{{reactRules}}` already gates its block, would close it. *(This one is a concrete, low-effort parity fix — it mirrors the existing `reactRules` slot; the react force-append is gated at `generate.routes.ts:1892`, while the emoji/sticker reply advertisements are appended unconditionally in `packages/server/src/routes/generate/conversation-custom-assets.ts:316`/`:369`.)* - Any other currently-fixed auto-insertions that lack a macro and are feasible to expose (e.g. summaries / daily history, the current date-time block, etc.). ## Alternatives considered - Preset section ordering controls — partial: they can reorder fixed sections but don't allow inline wrapping (`{{#if}}`, custom surrounding text) around the block the way a placement macro does. - Leaving these as fixed automatic insertions — the status quo this request addresses. ## Additional context Follow-up to the new Conversation macros. The reporter notes they're not certain what's technically feasible and would appreciate whatever subset can be exposed. Filed alongside the conversation-macro bug reports #3435 (`{{#if}}` + macros), #3436 (auto-block suppression), and #3437 (macro docs). In particular, any new placement macro should suppress its auto-inserted counterpart the same way the existing relocation macros do — see #3436. ## Template check - [ ] I DID NOT read this template and provide the requested details.
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#1860
No description provided.