mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3379] [Feature]: Add relocate/suppress macros for auto-inserted conversation contexts (memories, status/time, emoji-react, command list) #1827
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1827
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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:
<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:
packages/server/src/services/generation/conversation-history-runtime.tspackages/server/src/services/generation/conversation-context-block.tspackages/server/src/routes/generate.routes.ts(~1753-1762)packages/server/src/services/generation/conversation-command-runtime.tsThe 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 atmarker-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 forchat_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.
@SpicyMarinara commented on GitHub (Jul 8, 2026):
Addressed in #3388 and merged to staging.