[GH-ISSUE #3380] [Feature]: Way to exclude a persona/character field from auto-insertion without rendering it in the prompt #1829

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/3380

Originally assigned to: @SpicyMarinara on GitHub.

What's being requested

A way to tell the engine "do not auto-add this persona/character field" without having to render it in the system prompt. Today, the only way to stop a field from being auto-inserted is to put its macro in the prompt so it appears in the final output — there's no way to say "don't auto-add it and don't show it," and no way to exclude a single field while letting the rest auto-add.

The user's attempted workaround (and why it fails)

They tried referencing the fields inside an always-false conditional, hoping the "using the macro suppresses the auto-insert" behavior would kick in without rendering anything:

{{#if user contains "DONTINCLUDETHIS"}}
{{description}}

{{personality}}

{{backstory}}

{{appearance}}

{{scenario}}
{{/if}}

It doesn't work: whether the auto-insert is suppressed is decided by whether the fields appear in the final, resolved prompt — not by whether the macros are present in the template. The {{#if}} is false, so the fields never reach the output, so the detector treats them as "missing" and auto-adds the whole block anyway.

Why (root cause — shared with the duplication bug #3377)

The identity auto-insert (injectIdentityFallbackMessages) decides whether to inject by scanning the resolved prompt text for the info — hasProfileBlock (packages/server/src/services/generation/character-prompt-context.ts:123-130) over allContent = args.messages.map(m => m.content).join("\n"). Because it's output-based, it cannot distinguish "the author deliberately excluded this" from "the author forgot to include it." It's also entity-level (all-or-nothing per persona/character), so there's no per-field control.

Suggested approach

Express suppression from author intent in the template, not from the resolved output — the same template-based / deterministic-flag direction already recommended for the #3377 duplication fix:

  • If the author references a field's macro anywhere in the template (including an unreachable {{#if}} branch), treat that field as "handled" → suppress its auto-add whether or not it renders. This makes the user's false-conditional trick work and delivers exclude-without-render.
  • For finer control, make the identity auto-insert field-granular (respect per-field references) so one field (e.g. {{backstory}}) can be excluded while the rest still auto-add.
  • Alternatively/additionally, a dedicated explicit opt-out would be clearer and more discoverable — e.g. an exclude token like {{exclude:backstory}} / {{persona:none}}, or per-field "auto-include" toggles in the persona/character editor.

Note: implementing #3377's fix via template-based detection would grant the entity-level version of this for free; the extra ask here is field-level granularity and/or an explicit opt-out affordance. Related: #3377 (identity duplication — same detection root cause), #3379 (macros for other auto-inserted conversation contexts).


AI-investigated against the current tree (v2.0.9); the output-based detection (hasProfileBlock scans resolved messages) confirmed, which is why an always-false {{#if}} can't suppress the auto-add. Filed as an enhancement per the reporter's request.

Originally created by @kolacheee on GitHub (Jul 8, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3380 Originally assigned to: @SpicyMarinara on GitHub. **What's being requested** A way to tell the engine "do **not** auto-add this persona/character field" **without** having to render it in the system prompt. Today, the only way to stop a field from being auto-inserted is to put its macro in the prompt so it appears in the final output — there's no way to say "don't auto-add it *and* don't show it," and no way to exclude a single field while letting the rest auto-add. **The user's attempted workaround (and why it fails)** They tried referencing the fields inside an always-false conditional, hoping the "using the macro suppresses the auto-insert" behavior would kick in without rendering anything: ``` {{#if user contains "DONTINCLUDETHIS"}} {{description}} {{personality}} {{backstory}} {{appearance}} {{scenario}} {{/if}} ``` It doesn't work: whether the auto-insert is suppressed is decided by whether the fields appear in the **final, resolved** prompt — not by whether the macros are present in the template. The `{{#if}}` is false, so the fields never reach the output, so the detector treats them as "missing" and auto-adds the whole block anyway. **Why (root cause — shared with the duplication bug #3377)** The identity auto-insert (`injectIdentityFallbackMessages`) decides whether to inject by scanning the **resolved** prompt text for the info — `hasProfileBlock` (`packages/server/src/services/generation/character-prompt-context.ts:123-130`) over `allContent = args.messages.map(m => m.content).join("\n")`. Because it's output-based, it cannot distinguish "the author deliberately excluded this" from "the author forgot to include it." It's also **entity-level** (all-or-nothing per persona/character), so there's no per-field control. **Suggested approach** Express suppression from author intent in the **template**, not from the resolved output — the same template-based / deterministic-flag direction already recommended for the #3377 duplication fix: - If the author references a field's macro anywhere in the template (including an unreachable `{{#if}}` branch), treat that field as "handled" → suppress its auto-add whether or not it renders. This makes the user's false-conditional trick work and delivers exclude-without-render. - For finer control, make the identity auto-insert **field-granular** (respect per-field references) so one field (e.g. `{{backstory}}`) can be excluded while the rest still auto-add. - Alternatively/additionally, a dedicated explicit opt-out would be clearer and more discoverable — e.g. an exclude token like `{{exclude:backstory}}` / `{{persona:none}}`, or per-field "auto-include" toggles in the persona/character editor. Note: implementing #3377's fix via template-based detection would grant the **entity-level** version of this for free; the extra ask here is **field-level** granularity and/or an explicit opt-out affordance. Related: #3377 (identity duplication — same detection root cause), #3379 (macros for other auto-inserted conversation contexts). --- *AI-investigated against the current tree (v2.0.9); the output-based detection (`hasProfileBlock` scans resolved messages) confirmed, which is why an always-false `{{#if}}` can't suppress the auto-add. Filed as an enhancement per the reporter's request.*
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:4918159191 --> @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#1829
No description provided.